At 11:01 28.06.2001 -0700, Peter Scott wrote:

>"Readable" is like "obscene" (in more ways than one, in some code I've 
>seen).  I spent a little time in my book (one day I hope to have to say 
>which book :-) going over pros and cons of different takes on this.  But 
>as it stands, "readable" is simply meaningless, and guaranteed to cause 
>friction.  Your elaboration doesn't help either.  "Readable" is only 
>meaningful in a context of how the code is going to be used and what your 
>tactical and strategic goals are.  Debating it in a virtual vacuum like 
>this is what I call a "pinhead" discusssion - how many angels can dance on 
>the head of a pin...

If you define "readable" as "simple enough for the extreme beginner to 
understand", I agree.  This is not only obscene, it also makes it 
impossible to take full advantage of the language, as some constructs are 
necessarily complicated, and require a firm understanding of Perl to decipher.

However, I think a general level of non-obfuscation can be reached.  When 
working in groups, it becomes a necessity.  It's a matter of finding a 
common style in the group.  This saves time when someone is on vacation and 
you have to fix a bug in their code.  If they go around naming variables $x 
and $y instead of $names and $sizes (or, even better, $raNames and 
$raSizes), you spend a lot of time just figuring out what's going on.  Many 
will argue (correctly) that no decent programmer would name his or her 
variables $x and $y outside of a for loop.  However, rejecting readability 
out of hand as catering to beginners leads to similar behavior.  I always 
prefer an extra line of code in the spirit of readability.  If nothing 
else, it saves me from getting phone calls when I should be laying on the 
beach :)


Aaron Craig
Programming
iSoftitler.com

Reply via email to