Comment by unleaded
1 year ago
This is a very common complaint about Lua and i really don't understand it. I get that it's weird but is it hard to remember it while you're programming or something? I never run into it much anyway but I guess it depends on what kind of code you're writing.
I think there's a lot more to language choices than syntax and weird behaviors like that, it's more about how you run/implement the language and the ecosystem and things like that. Think about when people say javascript is a bad language because if you add together two empty arrays you get the number 0 or something. Or think about how you might be annoyed if you had to use a desktop app written in PHP (yes people do this) because the author likes PHP..
I used to think the same as you about 1-based indexing in Lua... until I tried using Lua in a game engine. I was constantly getting hit in the face with problems (e.g. coordinate systems and off-by-one errors), even after spending far too much time trying to abstract around this mismatch to make these problems go away.
In theory I was okay with the indexing. In practice it was an absolute PITA.
Plus there were other numerous papercuts; it felt like Lua was actively fighting me every step of the way. I went from liking Lua to absolutely despising it.
In the end I switched to C++11, which amazingly was much more productive. As in night-and-day difference.