in reply to Re^2: nested tabular ternary
in thread nested tabular ternary
I can't make heads or tail of your "more readable" "table". Did you mistakenly used tabs?
Aligning ? and : provides the best results for me. Parens provide a visual scope:
$result = ($major_length == 4800 ? 18 : ($major_length == 8552 ? ($val == 4 ? 33 : ($val == 1 ? 18 : die "not handled") ) : die "not handled" ) );
And then there's Perlish:
; $result = ($major_length == 4800 ? 18 : ($major_length == 8552 ? ($val == + 4 ? 33 + : ($val == 1 ? 18 + : die "not handled") ) : die "not + handled" ) )
None of these are particularly readable &mdash or maintainable. if should be used here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: nested tabular ternary
by McDarren (Abbot) on Apr 11, 2006 at 03:03 UTC | |
by ikegami (Patriarch) on Apr 11, 2006 at 03:53 UTC |