3 ms·
Dijsktra on zero-based indexing: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08x
by Pxtl 13y ago
Dijsktra on zero-based indexing:
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...
Obviously the differences are small and it's not worth obsessing over, but I do think that zero-based approach works better with array code that involves offsets... and that's not the exclusive province of manually managed memory - array-index math can happen for many reasons.
Of course, one-based math is more intuitive to the layperson, which is obviously why it's the natural choice for Lua.
- endianswap 13y agoAnd for those who didn't see this on HN a couple of days ago, here's Guido van Rossum on zero-based indexing in Python: https://plus.google.com/115212051037621986145/posts/YTUxbXYZyfi https://plus.google.com/115212051037621986145/posts/YTUxbXYZ...