5 ms·
The only sane thing is to use if statements, imho. No ninja cowboy engineer nonsense.
by wlievens 16y ago
The only sane thing is to use if statements, imho. No ninja cowboy engineer nonsense.
- sukuriant 16y agoSometimes, if-statements unnecessarily add lines, and the lines become harder to read. I would say it's a case-by-case statement. Well, okay, more specifically, I would say that the use of a single ternary if is a case-by-case statement.
- wlievens 16y agoAbsolutely. I use ternary if when appropriate. But nesting ternary ifs is horrible, and nesting ternary ifs while discarding parentheses is malevolent.
- pbiggar 16y agoCorrect bracketing would be plenty in this case. If-statements sometimes (not always) make code much less readable than ternary operations.
- Ralith 16y agoThis is why more languages should adopt the every-form-returns-a-value paradigm.