/me waits for tye to rebut this ;-)
Anyway, I agree on both the spanning statements and the usability of unless. To me, unless is way better than "if not $foo". However, anything more complex is often easier to write and read as an if:
Switch that around to if, and it's easier to parse, I think.... unless $foo and not $bar->baz()
Still not easy, but I think that's an improvement of at least half a step.... if not $foo or $bar->baz()
Back to the otherwise statement. Here's just something to throw out there, more to provoke thought than as a serious suggestion. Rather than separating two statements, what would you think of:
Arguably, it's a single statement still. I think I still prefer the full if ($b) { $a } else { $c } version. But at least it deals with the "span statements" issue. Somewhat.$a if $b, otherwise $c;
In reply to Re^2: Useless unless
by Tanktalus
in thread Useless unless
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |