3 ms·
I can't believe people are still seriously trying to argue this. You count "things." You don't count "not things." Arrays are containers of things. Starting
by jrm4 4y ago
I can't believe people are still seriously trying to argue this.
You count "things."
You don't count "not things."
Arrays are containers of things. Starting with 1 is overwhelmingly likely the thing that makes sense when using them.
- shoemakersteve 4y agoArrays aren't just used for counting though. For example, the origin in cartesian coordinates is "0,0" and not "1,1". Not to say that I disagree, I don't think I've come across a situation where 0-based indexing would have been better for me personally. But there are definitely a lot of situations where I can imagine it would be preferable, like pretty much whenever you're doing math with them.
- programmer_dude 4y agoI'd say containing things is just one function of arrays. The other arguably more important function is "naming" things using numbers.
- jrm4 4y agoSure, but it seems like the latter isn't hurt by 1 indexing either, especially if the "names" are arbitrary, and if not, use associative?