Thursday, December 08, 2005
Culture clash - or java programmers in ruby world
If you live in a different country that you grown up in, you suddenly notice many things natives take for granted. There are of course differences in the way people dress, talk or eat. Some things are obvious: the mysterious correlation between a bad taste and programming skills among American hackers. But there is also many subtle and entertaining ways in which people behave, that provide endless conversation topics for expats. Laughing about it is a sweet revenge for all these situations in a restaurant when people are doomed to judge your IQ based on the familiarity with locally popular condiments.

In sipXconfig work I recently had an eye opening experience of a similar kind when we started using Ruby. Douglas and Walter used it to test sipXconfig SOAP interface, I got my toes wet (or should it be fingers) trying to automate importing data.

Since the novelty effect of a culture clash may wear off pretty quickly, I decided to record my experience while it's still fresh.

Well, Ruby is no Java. Ruby is like snowboarding and Java is like skiing (hence the culture clash). With Java you know where you are and you know what you cannot have. A list is a list is a list in Java and it'll be a list even after you look at this after especially intensive "coding" party. Your methods will not multiply magically. Which is comforting, but in a way sad. In Ruby you can teach a list a new skills. Classes are never closed. You can add methods, you can redefine methods. You can call methods and if they are not implemented you have a chance to do something about it in runtime. This is exhilarating and scary.

Some time ago I would not even dream about writing any serious code in a language like Ruby. I needed my compiler to catch as many problems as possible. I needed to guard my private data so that people like lazyboy do not break my beautiful code. But today I do not feel like that any more. Unit test provide me with all security I need. If it's not enough I can always write more unit test.

I also realized I became addicted to source code. Eclipse makes Java source code wonderfully accessible. Quite often I used to read library code instead of reading library documentation. Not so much for Ruby code. I am not sure if the reason for that is that Eclipse plugin for Ruby is just not good enough yet, or if maybe just too much of a library is written in C and I simply do not have source code for it. But I am a bit lost.

The good tool can make up for language real and perceived shortcomings. In Java you have to be more verbose. But that's hardly a problem if Eclipse nicely writes the most code for you. In Ruby there is a method for everything you can imagine. Finding this method name takes longer than most people would put up with.

Which brings me to the entire issue of Human vs. Minimal interface. Java users seem to be quite offended by Ruby classes with 75 methods. I kind of thing both sides are missing a point in this discussion. Culture clashes are not only entertaining. They also teach us new tricks. Java will benefit from Ruby, just a s Ruby already benefited from Java. And I am looking forward to using both.

Powered by Blogger