4 ms·
My first real job was mostly working in Lua and, to me, the real warts are the weird edge-cases in how Lua behaves. It's been a while, but IIRC I remember getti
by aeturnum 4y ago
My first real job was mostly working in Lua and, to me, the real warts are the weird edge-cases in how Lua behaves. It's been a while, but IIRC I remember getting caught by how Lua will not insert nil into the array values of a table, but it will skip the index, so you end up with gaps in your tables' values unexpectedly.
example:
a = {1, 2, 3, nil, 4}
for i in pairs(a) do
print(string.format("%i -> %i", i, a[i]))
end
[...]
1 -> 1
2 -> 2
3 -> 3
5 -> 4
There are just tons of little quirks like that in the language. They don't matter if you are doing light work, but they come to be really important for more developed things. I still love it, but compared to other dynamic languages you needed to be super careful about types and values and data consistency in a way that caused development to slow.