3 ms·
> Funnily enough, lots of coders aren’t that great at math, so long as you remember to zero index, you’re fine. I would add “…and keep your ranges as lower-inc
by teddyh 7y ago
> Funnily enough, lots of coders aren’t that great at math, so long as you remember to zero index, you’re fine.
I would add “…and keep your ranges as lower-inclusive, upper-exclusive.” Interestingly, both of these have related reason why: https://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF https://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF