October 21, 2004

Filler 28

I have always depended upon the strangeness of strangers.

Big news of the day, which should give you some idea of how profoundly unexciting it was, is that I wrote my first ever program in Perl. And it was actually very handy, none of yer "hello world" bollocks. A long way from being the most elegant code I've ever written, but it got the job done.

Despite Perl's seemingly unassailable position as the lingua franca of web development, I have managed to avoid it pretty successfully all these years. Once in awhile I've had to read a Perl script and try to work out what the fuck it was doing, and that was bad enough; actually writing the stuff was altogether beyond the pale.

No more.

Have the scales fallen from my eyes? Well, yes and no. I already had a fair idea of Perl's merits or I would never have considered it in the first place. I also had some sense of its ghastliness, and that hasn't changed.

Perl is a crackpot programming language. I know several others intimately, but I don't ever expect to do more than skim the surface of this one, gazing down into its chaotic depths with something akin to fear, praying not to plunge through the surface. If I had been safe at home on OSX, I might never have ventured to try it -- the job could have been easily bodged up with some mess of shell script and awk, or Python, or PHP, or hacked out in Java or C. On the creaky Win2k box at the office, none of those were really an option, but I knew there was a full Perl install. It was that or get to grips with VBScript, and you have to draw the line somewhere.

The result is: I am semi-persuaded. For quick, off-the-cuff hacks, Perl really looks the business. It's a lot easier than a "real" programming language, insofar as you can get some real work done with relatively little effort: munge a few files together, run some text transformations. On the other hand, it's incredibly opaque, a classic write-only language. Complex systems -- such as the one that manages this blog -- have been written in it, but I can't for the life of me imagine how.

Perhaps this is the beginning of my conversion. I can certainly see myself using it for various tasks. I guess only time will tell.

Not much else to report, really. Tuesday was the traditional stepping and bouncing affair. My back somersaults have turned to complete crap yet again, but what can you do?

I need more strength, for the flying especially, but I'm just not motivated to acquire it. My friend Stuart, recently returned from Northern Ireland, has just joined the Y, and we're supposed to be pushing each other to do weights and stuff, but that hasn't quite kicked off yet.

Next week for sure...
Posted by matt at October 21, 2004 01:30 AM

Comments

Matt, I'm very worried about your mental state, first depression and now Perl, where will this end??!?

Posted by: James Fryer at October 21, 2004 09:14 AM

After that little sally, am I supposed to defend Perl? I mean, it's probably the language I spend most time in these days, but I still fear it for large scale development.

I can see how it's done, though - objects don't look like objects in Java or C++, but they work more or less the same. And if I am doing text processing I will choose Perl over almost anything else.

It came in very handy for migrating my email from Mail.app to Thunderbird, too.

Posted by: Dunx at October 21, 2004 05:41 PM

[James] Scientology. And Cobol. At the same time.

[Dunx] You weren't supposed to defend it, but I did wonder, just for a moment, whether you would :)

Posted by: matt at October 24, 2004 08:35 PM

I have a soft spot for Perl. Partly because it was the language I cut my teeth on when I started my career (when I had one that is) but mainly for characteristics that make others despise it.

I love the way that Perl usually offers several ways of doing the same thing. And in my sick, depraved, anti-social way, I like that you can write very terse, incomprehensible code to accomplish things that would be considerably more verbose in most other languages.

The fun I'd have whiling away boring afternoons whittling down great hunks of code to a single, but indecipherable line of Perl, all the while knowing that whoever succeeded me would probably have a brain haemorrhage trying to work out exactly what it did.

If I'd done something particularly obscure I'd even put in some nonchalant little comment as a clue to what was going on, before sitting back to spend the rest of the day admiring my creation. The joys of working in the public sector.

But I fear there may be some correlation between playing with Perl and depression.

Time to go back to the padded cell...

Posted by: Shyboy at October 24, 2004 09:49 PM

It's interesting to read your comparison of various computing languages and compare them with my own thoughts about the merits of various human languages and in particular their grammars.

Swedish, for example, is a model of simplicity and good design (go figure!), with very streamlined verb tenses and hardly any irregularity. I mean, even the verb "to be" is almost completely regular!

Polish, on the other hand, is completely arcane, with the most extraordinarily complex exceptions which are straight out of Mornington Crescent. Special rules apply to masculine personal nouns in some cases, and some numbers take the nominative, others the genitive, to give you but two tiny examples.

I must say that there's a certain sort of machiavellian thrill attached to assembling a sentence such as Trzech Polakow czeka na autobus. (Three Poles are waiting for a bus). It looks simple enough, but behind the scenes it's mind-boggling. "Three" (special version of the number for masculine personal nouns) "of Poles" (has to be in the genitive after that type of numeral) "waits" (yes, waits in the singular), "for the bus".

Whether the bus ever arrived isn't stated.

Posted by: Eurodan at October 26, 2004 09:06 PM

Comments for this post are now closed, but feel free to email me if you have something interesting to say.