2 ms·
Both factorizations feel the same to me, without context. Subsequent numbers are greater than the previous ones vs. subsequent numbers are lesser than the previ
by dmos62 6y ago
Both factorizations feel the same to me, without context. Subsequent numbers are greater than the previous ones vs. subsequent numbers are lesser than the previous ones.
What should really matter is how you're "talking" in the code. If you've defined some relationship as y being greater than x, then that's how you should phrase the comparison as well: (> y x). (< x y) would be the same thing logically, but we don't read logically: it requires another mental step to understand that (> y x) and (< x y) are equivalent. It's avoiding those extra steps that gives code a really big readability boost.