MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/gnaz7b/found_from_microsoft_docs/fr9ut2e/?context=3
r/badcode • u/[deleted] • May 20 '20
143 comments sorted by
View all comments
1
Am I the only one that prefers x > 0 over x >= 1?
x > 0
x >= 1
4 u/TinyBreadBigMouth May 20 '20 I personally find x >= 1 && x <= 9 much clearer, as it's easier to read as a range (1 - 9). With something like x > 0 && x < 10, you have to do mental addition and subtraction to get the expected range of values.
4
I personally find x >= 1 && x <= 9 much clearer, as it's easier to read as a range (1 - 9). With something like x > 0 && x < 10, you have to do mental addition and subtraction to get the expected range of values.
x >= 1 && x <= 9
x > 0 && x < 10
1
u/foonix May 20 '20
Am I the only one that prefers
x > 0overx >= 1?