|
|
|
|
|
by fl0wenol
2751 days ago
|
|
Qualification: Don't use the greater sign when doing range checks. Counter-point: When checking if a variable is greater than a constant, using the less than is very confusing since we read left to right. if(x > LIMIT) { Read "If x exceeds LIMIT, then" The opposite reads like "If the LIMIT is less than x", which sounds strange and emphasizes the wrong thing, implying LIMIT changed, not x. |
|
But if the way you think about the domain is "if x is larger than LIMIT..." you should write it `if (x > LIMIT)`!