News for hackers. Stuff that matters.
Re:Lua, a Misunderstood Language by noizejoy on Friday January 15, 2021 @05:25PM (#25797350)
It doesn’t miss the point, because the point was that non-developer humans will do better with 1 based indexing.

Side note: As a former developer, turned regular human being who scripts from time to time, I don’t find switching between 0 based and 1 based indexing particularly intellectually taxing.

Re:Lua, a Misunderstood Language by TulliusCicero on Friday January 15, 2021 @05:28PM (#25797376)
Yeah I have a bunch of complaints about the language that I developed while learning it and simultaneously teaching my 9 year old kid, but the 1-based indexing isn't one of them. That's totally fine, and certainly easier to grasp for a beginner.

But there's certainly other stuff that's just weird and bad, and I think just the fact that it's dynamically typed made it harder for him to build an accurate mental model -- sometimes he didn't even realize that an identifier that he had typed in earlier was a variable, let alone what kind of value it'd be holding.

Re:Lua, a Misunderstood Language by zajio1am on Friday January 15, 2021 @05:34PM (#25797428)
Well, i started programming in Pascal (with 1-based indexing) and later switched to C. I remember that after switching to C off-by-one errors magically disappeared.
Re:Lua, a Misunderstood Language by billfruit on Friday January 15, 2021 @05:57PM (#25797665)
Wait till you need to use a formula which has somewhat complex uses of indexes like 2^(2n+1) and see how having deal with them in 1-base indexing in addition to 0 based indexing makes it add bit of unnecessary confusion.
Re:Lua, a Misunderstood Language by craftinator on Friday January 15, 2021 @05:57PM (#25797671)
It's not an intellectually challenging context switch, which is actually what makes it such a problem. You don't have to think about it, because it's so simple and easy, so sometimes you won't even think to do it.