3 ms·
As a general principle, everything else being equal, less information density is simpler. Ternary operator is quite dense. Think about it: algebra (most of it)
by candiodari 10y ago
As a general principle, everything else being equal, less information density is simpler. Ternary operator is quite dense.
Think about it: algebra (most of it) is just simple concepts incredibly densely written down and recursively applied. There are very few really complex parts in it, by which I mean there's very few individual steps that take long to understand, there's just so bloody many of them and they link together so incredibly tightly.
- the_af 10y agoBut everything else is not equal; the if-else construct is less clear, more error prone, and you must read it fully to make sure all branches are assignments and that it's therefore logically equivalent to an assignment.