3 ms·
"Its far too easy to simply skip over it as a simple assignment operation." This can be mitigated with parenthesis around the conditional statement. "ternary
by clutchski 16y ago
"Its far too easy to simply skip over it as a simple assignment operation."
This can be mitigated with parenthesis around the conditional statement.
"ternary notation ... [is] great for saving (a little) time"
I like it because it allows for immutable variables (enforced by fiat, of course), without writing four lines of "if ... else .."
That being said, it can be abused: http://www.google.com/codesearch?hl=en&lr=&q=%22%3D%3D+true%29+%3F+true+:+false%22&sbtn=Search http://www.google.com/codesearch?hl=en&lr=&q=%22%3D%...