in reply to A matter of style: how to perform a simple action based on a simple condition?
What GrandFather said. I use Perl because it's not all those other construct limited languages that force you to reason like a 50s robot. The length and complexity of the code will change what is easiest to read but in general, this is what I'd say for all simple clauses, so this is what I understand the most easily–
Go shopping later if you can. Take out the trash if it's full. Open the windows if it's too hot.
The inverted statements are sensible of course but they begin to put a lot of weight on the conditional and make you think harder about the potential interpretation(s) of the statement. I also think postfix unless is much easier to follow than the block version.
Go dancing unless you're tired.Though being Perl, I don't mind seeing the other constructs and don't blame anyone for preferring them. :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: A matter of style: how to perform a simple action based on a simple condition?
by Tux (Canon) on Sep 26, 2010 at 18:27 UTC | |
by Your Mother (Archbishop) on Sep 26, 2010 at 21:45 UTC |