in reply to Ternary operators: a hinderance, not a help
If it's used to enhance readability, I'm in favor. Look at your example -- 7 lines of code vs 1 line of code. As long as the tests and predicates are short, single line constructs, I think the vertical space savings of the ternary operator are worthwhile, even when chained.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Ternary operators: a hinderance, not a help
by Tanalis (Curate) on Aug 09, 2005 at 18:10 UTC | |
by fizbin (Chaplain) on Aug 09, 2005 at 20:55 UTC | |
by Anonymous Monk on Aug 10, 2005 at 10:56 UTC |