Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Advantages of Ruby over Java

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

What do you think about advantages of ruby over java. Can I Opt ruby over java??
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really like the dynamic nature of Ruby.
It's really suitable for DSL..

Example:
For fans of Tenacious D: http://judofyr.net/posts/tribute.html
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If those (the dynamic nature and being good for dsls) are the only things going for Ruby, then groovy might be a better recommendation. Java to Groovy is a pretty much instant transition, whereas there is a (slight) learning curve for Ruby.



That said, I really like Ruby and find it a joy to program in, even if these days I'm doing more groovy work.
 
author
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally I think your choice of a language comes down to many factors. For me, Ruby is probably the most fun I've had developing in any language, and that means a lot. I've also received dramatic productivity boosts since moving over. There are certainly a few things that aren't perfect, but that's true of any language.

If you're coming from a Java background and interested in getting your feet wet with Ruby you may also want to take a look at JRuby. It runs in the JVM, can leverage existing Java classes, and deployment will be familiar -- it can be packaged and served as a WAR. And yes, it can run Rails.

Unfortunately I haven't had the time to play around with Groovy, so I can't make an informed comparison. I'd love to hear other peoples' thoughts on the matter though!
 
sumeet gupta
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I m pretty new to ruby.Can anyone refer me some books for jruby?
 
Nick Plante
author
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although I haven't personally read it, Ola Bini's JRuby on Rails book might be a good start. I actually have a copy but just haven't found the time to dig in!

http://www.apress.com/book/view/1590598814
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ruby has some features that a Java developer may well appreciate.

Example 1: Everything is an object


Example 2: Everything is a method: new, for loop, iterator, instanceof etc.


Example 3: Relaxed syntax


Example 4: Easy to remember API


Example 5: More compact code


Example 5: Every instance variable is by default private

Example 6: Define default values to method arguments

and many more.

I do agree with Nick that Ruby is fun!
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic