• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advantages of Ruby over Java

 
sumeet gupta
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??
 
JohnnyBusca
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
 
Jason Mayer
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.
 
Nick Plante
author
Greenhorn
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
Greenhorn
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
 
Nikos Pougounias
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic