Syntactic Confectionery Delight | |
PerlMonks |
Re: Control Flow - Multiple returns or nested conditionalsby Your Mother (Archbishop) |
on Oct 07, 2010 at 17:37 UTC ( [id://864048]=note: print w/replies, xml ) | Need Help?? |
I'd argue for whichever structure feels the most natural for the given use. I find that I have to twist or contrive temporary variables and such more often when attempting to avoid multiple return statements so I tend to prefer the multiple style. As others have said, it is often easier to read and avoiding long or deep nesting almost always improves readability.
In Section
Seekers of Perl Wisdom
|
|