Not Quite Getting It

Stories of obfuscated Perl written by incompetent people (or sadists) are legion. But sometimes you come across some code that appears as if it was mostly written by someone who knew what they were doing, but seemed to be missing some crucial bit of information.

Today I saw a set of OO Perl packages that appeared perfectly cromulent, until I noticed that every method call looked like this:

The rest of the code was clear, well-structured, logically modularized, and even unit-tested. Apparently, this otherwise perfectly good programmer was either completely unaware that Perl methods can take parameters, or, for reasons that are lost to the mists of time, chose not to use them.

2 Comments

That's what makes it so strange. It's one thing if it's written by a n00b who doesn't know any better, and randomly stumbles across something that works, but quite another to see such bizarreness in the midst of otherwise good code.

My guess (and it will have to be a guess, since the author has dropped off the face of the earth) is that this was some sort of ill-conceived attempt at premature optimization.

Leave a comment

Name

Email Address

URL

Remember personal info?

Comments
(You may use HTML tags for style)

About Mike Friedman

Mike Friedman is a professional computer programmer living and working in the New York City area.