2 ms·
Well, that seems cool, but isn't indexing from zero simpler? I don't really remember if zero-indexing was a big deal when I was learning to program. Are there
by pasabagi 6y ago
Well, that seems cool, but isn't indexing from zero simpler?
I don't really remember if zero-indexing was a big deal when I was learning to program. Are there big advantages for non-programmers? I figure that's why Lua went the 1-index route.
- ddragon 6y ago>I don't really remember if zero-indexing was a big deal when I was learning to program And neither is 1-indexing even though people are always complaining about it. I kinda like when indexing from the third element to the seventh element to be just 3:7, instead of 2:6. and the last element to be length(x) instead of length(x)-1. And that use case is much more frequent to me than creating circular buffers on an array. And in Julia you can just use begin:end as well, or any iterator, it's really overall a non-issue for me. Not sure about Lua, but in Julia (and Matlab, and R) is just because they actually have vectors/matrices types that have a convention that predates even programming, while it makes sense for languages that an array is basically a memory offset (that maps to a pointer arithmetic logic) to start in 0.