A real gem
(Fri Oct 04, 2002) [/Ruby] #
I dig Java. Besides being the language that rescued me from five long years coding in C++, Java has paid the bills over the last six years. I remember keying in my first Java program, ironically from the pages of a Microsoft Press book a colleague loaned me. Since then the number of Java APIs has grown to staggering proportions. It seems you can do just about anything in Java these days, and I continue to have good success with it, especially building enterprise apps.
But I don't want to be a one-trick pony. After attending a conference session by Pragmatic Dave earlier this year, I started to try my hand at Ruby. Now when I program in my sleep (all programmers do that, right?), I see Ruby code.
Ruby is a top shelf object-oriented language that started in Japan, but has created a groundswell in the U.S. over the last couple years. It's a dynamically-typed language, with types bound to objects rather than classes. An object's type is determined by which messages (methods for us Java/C++ hacks) the object responds to. Yes, I know what they taught you about the goodness of strongly-typed languages: Write code with lots of syntactic sugar and let the compiler sort it out. Trouble is, we mere mortals have to read and write the code.
The beauty of Ruby is its simplicity and consistency. With Ruby, I find myself writing code to get the job done rather than to appease the compiler. Using test-driven development gives me all the confidence I need that the code is reliable. Will Ruby supplant Java? Nah. But there are many general purpose programs and utilities that could be written quite effectively in Ruby. In my limited experience, programming in Ruby is just good, clean fun!
If you want to learn Ruby, I recommend that you run, don't walk, to your nearest bookstore for a copy of Programming Ruby. I promise that looking into Ruby will give you a different perspective on whatever language you're currently using. You'll be sharpening the saw.
