14
bkrem
8y

Reading about Lua, see this:

"Lua arrays are 1-based: the first index is 1 rather than 0 as it is for many other programming languages (though an explicit index of 0 is allowed)."

*close tab*

Comments
  • 1
    Haha, yeah, it is sort of crazy. Even crazier, IMO, because Lua is actually a pretty cool language if you can get into it a little. At least I enjoyed it when I used to make games with it.
  • 2
    Exactly, really liked what I was seeing beyond that in terms of scripting. I'll come back round to it no doubt once the mental recoil wears off 😬
    I get why they made that choice too since it was aimed at people not familiar with programming, but seems like the mother of all off-by-1 bug sources for the rest of us
Add Comment