Ward Cunningham creates PatternShare community Is Test-First Development an Impediment to Creative Flow?
Feb 02

What a Java Programmer Should Know About Ruby

Java, Ruby, Tech Add comments

Jim Weirich has got a public list on Things a Java Programmer Should Know About Ruby.

This list does tell you a lot, although there are a few politically charged ones:

  • Fixed what’s wrong with Perl
  • Fixes what’s wrong with Python
  • It’s super productive (like Perl, Python and Smalltalk)- maybe 5-10x Java.
  • Is a lot like Smalltalk, but doesn’t look as funny
  • Is a lot like JavaScript, but more OO and more for full app development

Try to ignore those a little (no matter how you feel about any of them) and stick to the technical side.

Personally, I find myself smiling more when I write Ruby code. It just fits me well.

And I love items such as:

while line = gets do
puts "Found: #{line}" if line =~ /start/ .. line =~ /end/
end

The core items that help me out are:

  • Duck Typing: Thinking in terms of behaviour, versus strict typing via Class heirachies really helps me
  • Closures: I go on and on about this one I know. I just love the clean code that comes out of it.
  • Dynamic Typing: I just don’t by in to the static typing way. Although I see some benefits, it gets in the way too much. And, as Dave Thomas puts it… Java isn’t fully baked in this area as if it was, there would be nice need for ClassCastExceptions :)

Now, there are items in other languages that are also gems. I definitely miss IntelliJ when writing Ruby code :)

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?

Loading...