Monday, June 26, 2006

I’ve said it before – I like Perl. It’s a useful language for doing some things. I think it’s used by too many people for things that it shouldn’t be, but then most languages are. It’s not my choice for a main language, but it does some things pretty well.

That being said, I have to say that I’ve been playing around with Ruby a bit more lately, and I’m starting to like it better than Perl. There are two main reasons for this – the first is that it’s a lot more cross platform than Perl is. You can actually use it on Windows without fear of strange quirks (O’Reilly makes Perl on Win32 for a reason). Second, the syntax is a whole heck of a lot more readable.

Okay, so regular expressions still look like my cat ran across the keyboard, but they always have and probably always will. For the rest of it though, Ruby’s object oriented nature makes the code look a whole lot less complicated, and the less time I have to spend trying to figure out what an app does, the more time I have for solving problems. I like being able to do things like call somearray.length to get the length instead of trying to assign the array to a scalar in order to get how long it is. It just makes a heck of a lot more sense.

Let’s face it, Perl is probably the only language in the world in which you can roll your head across the keyboard and then watch the resulting script compile. There’s no guarantee as to what it will do – for all you know before you run it, the script may end up causing a rift to open at your feet from which emerges Huang Ti along with a standing field army of terra cotta golems animated by the spirits of the soldiers that were under his command when he was alive (if this confuses you, don’t worry. It’s sort of an inside joke. Though if you’re just wondering who Huang Ti is, he was the first emperor of China). Then again, it may do no more than the program I wrote once when I was 21 after I had been out with some friends for the weekend (it compiled, but I have no idea what I was thinking when I wrote it), but the chances are that it will compile.

In all honesty, I believe that there is a reason Larry Wall, the creator of Perl, has won the International Obfuscated C Contest twice.

Perl, you have been useful, and I may still end up using you on occasion, but I think that, for the time being at any rate, Ruby is going to become my choice as far as scripting languages go.

Current mood: neutral
Current music: Michael Hutchence – Slide Away

No comments: