Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm glad you picked argument passing as your example, since the ugliest piece of bad Perl I've ever seen(Hey, two out of three ain't bad) is argument passing. I was beginning to maintain an out-of-house piece of Perl, and was happily reading through it sorting the small pile of wheat from the large pile of chaff when suddenly I hit a brick. The programmer had, I think, intended to get the kind of default arguments that hashes can easily provide.. but had tried to do it without any kind of hash. They also had odd argument ordering, with related arguments randomly places around the sequence so often the value you needed to default would be in the middle of the 'full' list. I think they were just adding new items to the end as they became required. I'm now in a new job, so I can't get this code to show you, but here's the essence of how it worked. I'm refusing to comment this, for those Initiates of Perl who can't work out how this works think yourselves lucky and go and reread the hash method. And yes, the 'use strict' and -w bits were added by me for my example. They didn't use these either, oddly enough.
I'm thankful not to be in that job anymore. Other bits of wonder I've seen..
I love maintaining the code of people who don't really know Perl, it's ingenious some of the things they can get up to. In reply to Re: Perl aesthetics: the good, the bad, the ugly.
by Molt
|
|