News for hackers. Stuff that matters.
Re:Lua, a Misunderstood Language (2021) by jrm4 on Thursday September 29, 2022 @01:53PM (#33024597)
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.

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.
Re:Lua, a Misunderstood Language (2021) by jrm4 on Sunday October 02, 2022 @10:59AM (#33056412)
Sure, but it seems like the latter isn't hurt by 1 indexing either, especially if the "names" are arbitrary, and if not, use associative?