![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: A matter of style: how to perform a simple action based on a simple condition?by BrowserUk (Patriarch) |
on Sep 26, 2010 at 22:38 UTC ( [id://862133]=note: print w/replies, xml ) | Need Help?? |
I find all of the justifictions in support of option 3 over option 2 utterly bogus.
Justifictions all. Personally, I use option 1 when I have a simple condition/action pair with a postfix for or while in performance critical loops. Otherwise I use option 2. I see no advantage in option 3, beyond the need for a else. And I'm, as likely as not to code that as:
But then, I've been used to postfix conditions and loops--including nested postfixes, which I was pleased to see made it into Perl6--since Basic Plus days, 25+ years ago. I wouldn't mandate them upon anyone, but I abhor them being demonised. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|