infundibulum

Language Wars

April 29th, 2005

There has been a conflagration of Python vs. Ruby flames of late — you don’t need me to add more links to all that stuff. Actually, I’m glad it’s happening. Guido, for instance, has recently added anonymous blocks to Python, citing Ruby’s influence directly. Sensible guy, Guido.

I’m not a hardcore language design wonk by any stretch of the imagination, I’m just a workaday hacker. But I know a fair amount about natural languages, and I think there’s an interesting comparison to be made here…

A lot of people will tell you that they don’t have a “knack” for learning languages. Usually what they mean is that they took high school Spanish or French and hated it. A question I think is too rarely asked is which languages do you not have a knack for learning?

I have learned a bunch of languages — Spanish, Portuguese, a fair amount of Japanese, some Thai, some Welsh, some Bengali, and a tiny bit of Dutch and Finnish. It’s just something I like doing. But I don’t think that I have a knack for learning “languages,” I think I found languages that suited me. I have tried and failed to like German. I have also tried and failed to like Russian, Irish, and Hindi.

I have no idea why I like Dutch but not German. There is no rational explanation, really. At least, none that I can articulate: the languages are very similar, just so with Irish and Welsh, Bengali and Hindi.

When someone says they are a good swimmer, no one assumes as a consequence that they are a good runner. No one claims to have a knack for “sports.” When someone tells me they don’t have a knack for language, I tell them they should try another one. My sister never really got past the basics of Spanish or Hebrew, but for some reason she seems to be making considerable progress with Arabic. Why that language but not the others? No idea.

And I suspect that programming languages are just the same. There are too many parameters to evaluate and say “this language is best.” Programming languages are not as complicated as natural languages, but they are complicated enough to warrant recognizing that we don’t really know what makes our knacks click.

Python and Perl fill the same niche, it is true. But Python likes me, and Perl doesn’t. I like Perl people just fine, and I think Larry Wall & Co. are cool folks, I have a giant stack of Perl books that I read on a regular basis. But Perl feels like a foreign language to me, and I suspect it always will.

Thank goodness there are a lot of languages out there.

Aquarium

April 14th, 2005

I’ve been lurking on the Subway mailing list a bit. Subway, in case you’ve not heard of it, is vaguely analogous to Ruby on Rails.

Which you’ve heard of, a lot.

Anyway.

Rails and Subway are both examples of the MVC (Model-view-controller) approach to application development. This is all news to me, and I’d not heard of it before all the Rails publicity cranked up. Here’s how Wikipedia describes the approach:

Model-View-Controller (MVC) is a software architecture that separates an application’s data model, user interface, and control logic into three distinct components so that modifications to the view component can be made with minimal impact to the data model component. This is useful since models typically enjoy a fair degree of stability (owing to the stability of the domain being modeled), whereas user interface code usually undergoes frequent and sometimes dramatic change (owing to usability problems, the need to support growing classes of users, or simply the need to keep the application looking “fresh”). Separating the view from the model makes the model more robust, because the developer is less likely to “break” the model while reworking the view.

Which is all besides the point that makes people actually care about this stuff, which is simple: Less code.

And in fact people have been cranking out Ruby on Rails apps at an astonishing rate. So it was sort of sad to see my beloved Python seeming to fall behind. (Ian Bicking has written two interesting posts about the situation: Why Web Programming Matters Most, and What Really Makes Rails Work.)

Well, there’s nothing like a little healthy competition, so I’m happy to report that some Python options are beginning to become apparent. Subway is of course one of them, and another, which I’ve only just learned about, is called Aquarium.

I tried Aquarium for the first time tonight, and I have to say that it was pretty exciting. Why?

Because it was freakin’ easy to install!

  1. Install Cheetah (Uncompress the Cheetah package and run python setup.py install)
  2. Install Aquarium (Uncompress the package, go into demo/seamstress_exchange and run python start.py. Then go to localhost:8000.

And, uh, whammo, AN APPLICATION. Okay, a very simple one. But my point is that every time somebody has an experience like this, the chances of success of the project increases. I for one am definitely going to start digging around in the code and see how it starts working.

One more tidbit that makes me feel extremely affectionate toward Aquarium right out of the box:

content="text/html; charset=UTF-8"

Ruby’s Unicode support isn’t as good as Python’s, in my experience… en garde, Railers!

:-P