in reply to Re: Useless unless
in thread Useless unless
/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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Useless unless
by chromatic (Archbishop) on Aug 06, 2005 at 05:22 UTC | |
|
Re^3: Useless unless
by friedo (Prior) on Aug 06, 2005 at 04:10 UTC |