Rant or die redux
A recent article was a repost. And it was a rant, pure and simple. Still, there was some substance to it, and it’s worth revisiting after four and a half years.
1 I have a theory. Perl programmers ready for another language go in one of two directions. If they are looking for a more robust object model, they turn to Ruby’s dedication to message passing. If they’re fed up with the syntax, Python’s significant whitespace looks really attractive. Perhaps obviously, i chose Python.
At the time, i was in a full-time position, working exclusively with Perl (and, consequently, with other Perl programmers). I was working with Python on hobby projects1. Sometimes, familiarity breeds contempt. I’m a freelancer now, no longer tied to a specific language. I do still work with Perl occasionally, but more of my time is spent with Ruby, Python, Haskell, and occasionally Java. I’ve mellowed quite a bit on the subject, though my opinions are still of the same flavor.
“There’s a reason Perl is known as a write-only language.”
My criticisms centered around two things: the syntax (which is pretty clear from the article) and the community (which might not be obvious). Let’s talk about the syntax first.
There’s a reason Perl is known as a write-only language. It can be a bloody mess. The fact of the matter is that, really, most code written in most languages is a mess, so it may be unfair to single out Perl.
On the other hand, i’m not the only one who dislikes sigils. For me, it’s not simply the sigils themselves, but the fact that they encourage messes like having $data, @data, and %data all within the same scope (leading to gems like $data{$data} = $data[$i]). Is stuff like that simply bad code written by a bad programmer? Yes, but in Perl it reaches a new level of unreadability.
But, really, much of the syntactic problems are matters of taste, not of fact.
The community issues are, i believe, more serious.
Perl is an agglomerative language. There’s nothing inherently wrong with that—many languages borrow features from other languages over time. I’m not even particularly concerned with the features being poorly or incompletely implemented. There’s much to be said for building things in a way which is idiomatic, or which sacrifices completeness for ease-of-use.
The problem comes in the community assumptions that the individual borrowed features, especially incomplete ones, are as valid as the features of origin. And the corollary that unborrowed features are not worthwhile.
“Frankly, programming concepts are hard. Everyone knows that.”
It’s easy to assume again that only the bad developers are likely to buy into these assumptions. That is less true than it is for the syntactic messes. The Sapir-Worf hypothesis may not be fully valid for natural languages, but it seems to hold water for programming languages and programming concepts.
Frankly, programming concepts are hard. Everyone knows that, when you start out, loops are hard, data structures are hard, recursion is hard. Later on, objects are hard, shared files are hard, processes are hard. Eventually, higher-order functions are hard, lazy evaluation is hard, macros are hard.
Except it’s not quite like that. If your first programming language is Lisp, then macros aren’t “eventually”, they’re “pretty early on”. If your first language is Haskell, lazy evaluation is something which you deal with immediately.
That’s the problem. Concepts become hard if the language you use has no easy way to express them.
And the problem hits double if you’re convinced the concept is bogus because it was never implemented in your favorite language. Paul Graham calls this the Blub Paradox.
Sadly, the Blub Paradox is all the more ingrained in users of agglomerative languages. Users of agglomerative languages don’t just see “weird languages” with “all this other hairy stuff”, they see “stuff we borrowed”, and “stuff we didn’t bother to borrow”. The only logical conclusion, if you trust the implementors of your language, is that the “stuff we didn’t bother to borrow” wasn’t worth borrowing.
And that’s my problem with Perl.
By john on September 20, 2007
Comments
No comments posted yet. Go for it!
Comments currently disabled due to impressive comment-spam efforts.