Re:Lua, a Misunderstood Language (2021)
by shoemakersteve on Thursday September 29, 2022 @05:34PM
(#33027528)
Arrays 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.
Re:Lua, a Misunderstood Language (2021)
by programmer_dude on Friday September 30, 2022 @10:06AM
(#33034995)
I'd say containing things is just one function of arrays. The other arguably more important function is "naming" things using numbers.
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.