2 ms·
My take on why ifs are "bad" is that they are statements, just like for, while, switch and others. Being statements they can't be composed as you would do with
by jeremiep 14y ago
My take on why ifs are "bad" is that they are statements, just like for, while, switch and others. Being statements they can't be composed as you would do with expressions.
- dragonwriter 14y agoThat's not universally true; there are languages where if is an expression rather than a statement (e.g., Ruby.)
- ufo 14y agoMost languages have a ternary if operator like (?:). I don't see how this is such a big issue.