Sunday, December 25, 2005

Perl to Python, Sure. But Ruby?

At my previous job, I worked most with Perl, though there was some occasional Python on the side. I enjoyed the occasional toying with Python, but I generally didn't spend much time with the language to have anything more than a passing familiarity with it. Google is a very Python-heavy company, though, so once I started here, I read the writing on the wall and switched 100% to Python.

Several thousand lines later, I'm now happy to say it is my scripting language of choice. Perl is great for one-liners and quick tricks, but Python is ubiquitous on Linux (and OS X) these days, eliminating one former reason for preferring Perl. But it's more than that; as powerful and expressive as Perl is, Python can pretty much match it at a language level. Thankfully, the spartan, chaste days of Python "there's exactly one way to do it" 1.5 are long gone. With Python 2.2 and higher, a huge number of powerful language features were added that really made Python not only effective but also fun.

I've eyed Ruby for a number of years now, but beyond some reading and toy scripts maybe five years ago, I've pretty much ignored it. The recent Ruby on Rails phenomenon brought it back to my attention, though, and I decided it would be a fun diversion during my holiday break.

Sadly, I was not enamored by it like I hoped to be. I thought it would be even more fun than Perl or Python, since it seems to have a heavily Perl-influenced design but cleaner object orientation like Python. But it just doesn't seem that great to me. Maybe I don't get it, but it offers, at best, incremental improvements over some aspects of Python at a cost of questionable syntax and obscure naming of some built-in modules, functions, and classes.

It seems like Gnome versus KDE all over again. Someone decides they can do a whole system better than anyone else and goes off and starts work, attracting volunteers and developing what is, at most, a resulting product of feature parity with an existing, functional, robust product. Sometimes this aspect of Open Source worries me. Imagine if someone had decided, by fiat, that Gnome or KDE would be the standard desktop environment. All of the engineering, testing, documentation, and community effort that went into the other would have instead gone into the chosen environment (though perhaps not as much of it -- still, it would doubtlessly have received significant contributions).

The argument that people seem to use to justify it, though, is that competition is good. Okay, sure, competition is good, but I think there is already plenty of competition out there already. Let's not needlessly divide our resources when there are bigger fish to fry, eh?

So anyway, back to my point. Ruby is nice (quaint?) but I'll stick to Python. Right now, it is the most vibrant Open Source scripting language there is (sadly, Perl is in a quagmire -- possibly a fatal one -- because of Perl 6). It isn't perfect, but it's darn good, and certainly good enough for many serious uses. Now if only Python had a serious CPAN-like service... ah well, I can dream.

3 comments:

Vardhman said...

I very much agree with this internal competition not allowing us to grow to meet external competition.
Gnome Vs KDE example is great too, as is the example of numerous number of PDF readers, image viewers, music player, browsers, and IM clients etc which keep changing in every version of FC or any other distro. Some command just get lost, standardization of apps is rarely talk about.
As a consumer I get amused by so many ways to do very simple things and not one perfect way to do all of them.
As a developer I get confused how to choose my platform for development so that maximum users can use it and also It can fit well with other apps.

Scott said...

This comparison of Python and Ruby got me thinking...

There's an MVC framework for Ruby called "Ruby on Rails"

There's an MVC frameword for ColdFusion called "ColdFusion on Wheels"

I think someone should put together an MVC framework for Python..and keeping with the language & transportation theme it should be......

Snakes on a Plane...

Vardhman said...

@Scott: Good one:)