Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Conditional style (if, &&) queryby rrwo (Friar) |
on Oct 17, 2001 at 14:19 UTC ( [id://119350]=note: print w/replies, xml ) | Need Help?? |
I would say what is most readable has to do with the "flow of thought" as to what you're doing. Perl is an "expressive" language in that you can say the same thing many ways. My rule of thumb: It's readable if a person with a decent knowledge of Perl who is going bleary eyed debugging the program for the last 12 hours can still make sense of the code and not mis-read it, and if the code is clear enough that it requires minimal comments. I usually avoid short-circuit expressions because they are often easily misread.
In Section
Seekers of Perl Wisdom
|
|