@andrewt does it help knowing that lua doesn't have arrays and you can index tables with whatever you want, including the number 0?
@mavica_again I mean that would help if it was meaningfully true, but it's not really, it is?
Basically all modern programming languages have something that's equivalent to and array and something that's equivalent to Python's "dict", and the fact that in Lua both of those are "table" is of monumental irrelevance to anyone actually *using* Lua.
If I type "a = {1, 2, 3}" into Lua I get an array indexed from 1. If I type "#a" into Lua it tells me the number of consecutive numbers that are valid indices of "a", starting from 1. Lua has a built-in implementation of arrays that is supported directly by specialised syntax. And it indexes them from 1.
@mavica_again Yeah, t[#t] is nice, but equally I think lua has no "append" function so t[#t+1]=x is just as annoying as t[#t-1] would be.
As far as I'm concerned, Lua indexing from 1 and Python's negative indices are the same problem: they prioritise readability with literal indices (of course t[1] isn't the *second* element; of course t[-3:] is the last three elements) over usability in complex programmes (t[i%#t] doesn't work in Lua, and t[centre-3:centre+4] doesn't work in Python), and this annoys me because "deep in a complex program" is when I am *least* able to deal with this nonsense.
JavaScript might be harder to just noodle about it, but the moment you start writing complicated functions, it does at least behave like a reasonable person would expect, which is really not true of either Lua or Python.
@andrewt `table.append`? @mavica_again
@andrewt That’s the fella. If only my memory was as reliable as the docs.
But yeah, it does feel clunky. @mavica_again