Monday, July 09, 2007

Snake on a... computer?

I'm afraid the following blog update is quite a sad one. Not 'sad' in the tragic sense, but rather 'sad' in the social sense, as an indication of eccentric and abnormally boring (to the lay public, at least) practises.

I have found the love of my (computer) life, and it's called Python. Every so often, you run into something that just clicks, in terms of the balance between usability and power. It's something I've experienced when learning to use bash (esp. the joys of SSH), or LaTeX (I wrote my last two papers and rewrote my CV with it), or when I finally go the knack for coding decent C; but when I say 'click', I think more of my discovery of object oriented scripting languages like Perl (which I had time to learn to basics of, but never to use) and Ruby (having shortly toyed with the syntax, but never used or learned in-depth). And it seems that until now, between Perl and Ruby, I had missed an important middle ground: Python. Actually, that's a lie... when I was 14 or so, I got my hands on a copy of O'Reilly's "Learning Python, Second Edition" (an edition with a cute little picture of a mouse on the cover, the macabre significance of which only strikes me now), but somehow did not get a chance (or the motivation) to peruse it fully.

However all is different now. Egged on by a recent conversation where I was weakly trying to defend the merit of learning C as a first language, I decided to give the legendary Python a try, and stumbled across this fantastic little guide (free, viewable online) by Mark Pilgrim, "Dive into Python" (which I heartily recommend to anyone with a minimal experience of some other programming language; it's exceptionally well designed, and concise). And Python did not disappoint me: it has the sort of 'message passing' syntax I liked in Ruby, the near-english aspect of which being similar to what I appreciated in Perl, and it has a fairly simple set of powerful built-in functions while remaining extremely extendable. In short, it's quite a pleasure to program with it, and I've been practising translating some of my C programs into it. The amount of code is significantly more minimal, and the data-sorting and string-filtering abilities save me many-a-headache.

Ironically arriving at a time where I have less need for a good programming language, it's quite a dream come true. I'm sure I'll find some use for it. In the meantime, if you're looking for a quick and easy to learn language, check Python out.

1 comment:

Anonymous said...

Real men use CaML.