in reply to A guide to coding Perl
One thing I like to avoid is excessive brace nesting. Mostly because I find it hard to make sure I've got the end braces right. Yes smart editors help, as does indentation, but I like the perl "statement unless condition" syntax a lot in my loops.
Enter any 47-digit prime number to continue.
What do I mean?
well I often see code like
What I prefer to see/write iswhile (cond1) { if (cond2) { statement; if (cond3) { statement; statement; for (range) { something; something; something; } } } else { last; } }
while (cond1) { last unless (cond2); statement next unless (cond3); statement statement for (range) { something something something } }
Dingus
Enter any 47-digit prime number to continue.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: A guide to coding Perl
by rir (Vicar) on Dec 12, 2002 at 02:57 UTC |
In Section
Meditations