Perlish Wisdom

2007-05-10, Comments

Here’s an interesting article in which Curtis Poe explains why there’s a shortage of Perl programmers on the market at the moment. I’m not qualified to comment on whether the shortage exists or his analysis of it is correct, but I certainly wouldn’t fancy maintaining Perl code. The Perl mantra, “There’s more than one way to do it”, appears to be liberating but all too often results in unnecessary inconsistency. I prefer Python’s “There should be one — and preferably only one — obvious way to do it”.

That said, I do have a soft spot for Perl. It was the first very high-level language I fell for. This was at a time when I routinely worked on different flavours of Unix and Windows machines; and I routinely had problems with the different environments. There wasn’t even a command shell which worked well across the board. Perl effectively gave me a platform independent way of writing scripts to perform simple file, text and job processing.

I say “scripts” rather than “programs” because I never wrote anything more than a few dozen lines long. I never had to go through the tiresome business of compiling, sorting out dependencies, locating include- and library- paths, declaring object types – tasks which I’d always associated with real programming.

Scripting was more direct, more fun.

A few dozen lines of Perl easily accomplishes as much as a few hundred lines of C. In fact, one line of Perl can get a surprising amount done. Surely the performance of an interpreted language would be a problem? Maybe it can be, but time after time, I was impressed just how quickly Perl allowed me to chew through data.

I had to admire the way the language grabbed all the characters on the keyboard and squeezed the juice out of them. It even allowed variables to dissolve away into defaults which you could then omit and which, as if by magic, did just what you wanted: $variable, $_, .

Ultimately, though, there were things I never quite got and probably never will get. I never managed to build complex structures without referring to the manual. Oh, and I never really got to grips with the Perl documentation system. I never found an editor mode I was completely happy with — or perhaps the overloaded syntax just started to grate. Finger saving tricks turned out to be expensive in the long run.

Adopting Perl changed me, though. I prefer powerful languages with comprehensive libraries. Wrestling with build systems seems too much pain for too little gain. And explicit type declarations make software frigid.