Archive for April, 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.

Anyway, there’s one comment on the post in particular that I found memorable:

I do like the idea of client-side templating, since with Ajax/remotescripting in play, the client *is* the server. People are experimenting with the best way to pass data back and forth — pass eval()able JS, pass XML and then parse it with a DOM clientside, pass formatted HTML to be slammed into the document. This is much the same as server-side things were, and templating is a good match there, so I see no reason why it wouldn’t be so on the client as well.

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.

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?

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!

Thaler, who hopes his book will be translated into English, says he loves words, but not verbs. “The verb is like a weed in a field of flowers. You have to get rid of it to allow the flowers to grow and flourish. Take away the verbs and the language speaks for itself.”