Is Ruby better than Java? No (and Vice Versa)

Pragmatic programmer Dave Thomas (Prag Dave) has written another entry in his excellent blog about the differences in languages ["Is Ruby Better than... ?"], particularly the punditry around comparing Ruby to Java. Something that I have recently been somewhat guilty of.

If you ask any of my colleagues about my choices in language, they would (hopefully) tell you that I am also a pragmatist when it comes to languages. I will write your software the way you want with the language you desire. But when it comes to my personal software, stuff I write for myself, I generally decide the language based on my current needs. For instance, until recently when I’ve needed a general utility, I almost always have written it in Java (or maybe in Jython), as it is the language (really its the API) that I am most familiar with. Some of my (much) older code is in C++. I still play around with VB when I want to do GUI screen layouts. However I am learning Ruby right now, and so for all new code that I write, I am choosing Ruby, unless there is a really good reason not to. This is not because I think Ruby is the answer to all programming ills, it is because I am trying to really learn it, and I will not be fortunate enough to get much on the job training for it.

Really it comes down to figuring out the best tool for the job. As Dave puts it “Is your chisel better than my hammer? If I’m forming dovetail joints, yes. If I’m nailing two-by-fours, no.”