What Every Java Programmer Should Know About Ruby
[ Aslak Hellesoy ] 02:08, Wednesday, 2 February 2005

Jim Weirich has written up an excellent compilation of what Javaheads should know about Ruby. I wish he had written up 2 years ago when I started to play with Ruby.

Java has been my language of choice for many years. Learning Ruby has opened up my eyes about what OO, agile development and extreme productivity should be like.

I'm not "converting" from Ruby to Java - I always try to use the best tool for the job at hand. Sometimes it's Java, sometimes it's .NET, sometimes it's Excel or PHP. More often than anything else it's not even about programming. But when it is, Ruby turns out to be the best choice for me more often than any other language. Probably because I'm an XP head. (And because I still don't know Objective-C or Smalltalk - it's on this year's TODO list).

Ruby - because I can get the job done fast and end up with super readable and maintainable code. And I'm worth it.

Now if those big corps that I tend to consult for would dare to do more things in Ruby... I reckon it will take a few years before we see them changing.


Comments

What suggestions do you have for an IDE? One of those points is about not having to check the docs every 5 minutes - I haven't actively stopped to check docs for _ages_, the odd Ctrl-Q in IntelliJ does that for me, and predictive completion (or whatever it's called) means I type way fewer characters than make up the source file. As VB has shown, a language's success is based as much on its tools as it is on the language itself.

Suggestions?

--Dmitri Colebatch, February 2, 2005 04:40 AM

COMMENTS

--KOIS, February 2, 2005 04:44 AM

Hi Dim - long time no see :-)

I haven't been using an IDE at all :-). The APIs in Ruby's standard library that I end up using the most are pretty quick to learn - thanks to the Principle of Least Surprise (http://www.artima.com/intv/ruby4.html) - a key element in Ruby's design.

When I *do* need to look up documentation (either in the standard library or some 3rd party one) I use the supplied RubyDoc, which is similar to JavaDoc. Here is an example: http://rake.rubyforge.org/

While having to leave your editor and use your browser to look up a method or class will take a little extra time (compared to Ctrl-Space or Ctrl-N in IDEA) this lost time is negligeable when you consider the overall increased productivity you get from Ruby in general.

You generally end up typing a fifth of the equivalent Java/XML - all while preserving clarity in your code. (Ruby is significantly different from say Perl when it comes to readability).

However, I still miss IDEA's refactoring support, so I may check out http://rubyeclipse.sourceforge.net/ soon. I won't recommend it until I've tried it, but it don't look bad.

--Aslak Hellesoy, February 2, 2005 06:00 AM

I use RubyEclipse. I like it, but it doesn't have refactoring support.

--bret pettichord, February 11, 2005 07:09 AM

Mostly agree with your points, but super readable and maintainable code? That is subject to debate, my friend. :)

--Obie, February 17, 2005 10:43 AM

Hi Aslak,

I'm not expert in Ruby (I read few documentation and ran Hello Worlds in RubyEclipse last night) and maybe you can correct me if I miss something. How code can be highly managable when Ruby allows you to add methods to existing classes? If I understand it right I can write ad hoc methods to my original class and it will be spread all over files. Do I miss something?

Cheers,
Fuad.

--Fuad Ibrahimov, March 13, 2005 10:15 AM

Hi

It is a great and nice post and I like it.

--shopping cart, July 17, 2008 05:32 AM
Post a comment









Remember personal info?