8 ms·
I spotted the incorrect one instantly. Why? Because there are two good ways to write this correctly, and he chose to not use one, and to use the other incorrect
by Claudus 11y ago
I spotted the incorrect one instantly. Why? Because there are two good ways to write this correctly, and he chose to not use one, and to use the other incorrectly in in his example.
5 < x && x < 10
10 > x && x > 5
Both seem equally readable to me.
His argument also seems predicated on the assumption that numbers are always increasing.
If x > 10 relax() else countdown(x) // easier to read "if timer is greater than 10, relax, otherwise, countdown"
If 10 < x relax() else countdown(x) // harder to read "if 10 is less than timer, relax, otherwise, countdown"