Re:Gpsd bug may create a 1024 week time warp on October 23
by inetknght on Monday August 02, 2021 @07:53PM
(#28044189)
> I don't know about you, but "week is greater than 2180" sounds more natural than "2180 is less than week"
To you perhaps. To me, I think "if I put both sides on the number line, which way is being questioned? and is that question answered true or false?"
And therefore I almost always do an equals or less-than comparison because that's how I think about the number line: 0 in the center with negatives on the left and positives on the right.
So `if (week < 2048)` is just as valid and easy to think about as `if (!(2048 <= week))`. But then `if (!(2048 <= week))` provides an additional guarantee: that I won't accidentally assign to `week`.
To you perhaps. To me, I think "if I put both sides on the number line, which way is being questioned? and is that question answered true or false?"
And therefore I almost always do an equals or less-than comparison because that's how I think about the number line: 0 in the center with negatives on the left and positives on the right.
So `if (week < 2048)` is just as valid and easy to think about as `if (!(2048 <= week))`. But then `if (!(2048 <= week))` provides an additional guarantee: that I won't accidentally assign to `week`.