by krylon · 4y ago · 0 comments
Who doesn't like Lua? That is right up there next to disliking kittens and puppies...
They're both valid options and it's just about preference.
I might be wrong, but I think math favors different starting indices based on the subject matter. I've seen Analysis textbooks favor 0 as the starting index. I don't think there's a clear argument for cultural transference from math.
I'm opposed to starting index from 1 because I think departure from very mainstream programming tradition should have a strong reason beyond preference, even if the de facto tradition appears equally capricious.
Saying the "the zeroth element" is just... weird and slightly nonsensical.
Aesthetically, it is repulsive, but when actually writing code in Lua, it was not much of a problem. I felt much stronger about "do"/"then" and "end" versus curly braces for delimiting blocks.
~= instead of !=
# instead of len()
Default declaration to global
-- for comments
Dereferencing something that doesn't exist returns nil