I really think this is just bikeshedding over style. If we were optimizing for readability and predictability, we'd standardize on the most commonly used format. ``if (x > 5 && x Putting a rule that variables should always be on the left hand side of a comparison also gives you only 2 ways to write any conditional, so it's just as good as getting rid of ``>``. It also has the advantage of being by far the most widesp…
But by far the best option is to not have a meeting at all and to not care about things like this. Indeed. This article reads like someone who doesn't understand inequalities, and proposes a quite possibly hazardous shortcut to it instead. To not understand such basic maths is baffling (this is primary-school stuff), and I wonder at the state of maths education these days to see adults struggling with these concepts.…
That said, I've come across code where the variable is always on the right. This often seems to be a throwback for some devs to alleviate the problem of mixing up equality and assignment.
That is, it seems that some people have been taught to use this expression (& stick to it religiously):
if (5 == x) ...
simply so that if they make a mistake and type
if (5 = x) ...
the (C/C++) compiler will reject it. So, these people always write the slightly more awkward case (imho) of:
if (5 x) ...
but to me it doesn't read as cleanly, because we don't say it that way.
Of course, there's the problem of understanding the meaning of 'between' which can be inclusive of the end points, or exclusive...and you really can't tell from the english. In every case, it needs to be clarified. (eg 'pick a number between 1 and 10'):
if (x>=1 && x<=10)...