[Pdx-pm] Readable code

Rafael Almeria almeria at earthlink.net
Mon Jan 10 23:24:08 PST 2005


> I've gotten in the habit of breaking my code out into lots of 
> subroutines because I've found that makes it much easier for me to 
> read and troubleshoot, a practice that seemed to be reinforced in Code 
> Complete. Now, however, as I read books on Perl and talk to Perl 
> coders I'm finding that placing an emphasis on writing readable code, 
> and breaking code out into lots of subroutines doesn't seem to be 
> considered "the Perl way" of doing things. The emphasis seems to be 
> tighter and tighter code, sometimes - it seems to me - at the expense 
> of readability (especially for those new to Perl).
>
> I'd be very interested in your thoughts and suggestions regarding 
> terse code, readable code, verbose code, etc...

Writing obfuscatory code certainly shouldn't be the way to do things; 
however, Perl does give you certain constructs which are very useful 
(as mental shortcuts) but perhaps difficult for the beginner.

Make sure your code is well thought out, commented and use good 
variable names.

Cheers,

Rafael



More information about the Pdx-pm-list mailing list