3 ms·
> For me, the indexed from 1 rather than 0 is a big turn off. I can't understand why people complain about that. If you're using 'pairs(table)' iteration then
by diego_moita 5y ago
> For me, the indexed from 1 rather than 0 is a big turn off.
I can't understand why people complain about that.
If you're using 'pairs(table)' iteration then the index doesn't matter.
If you're accessing indexes directly you can have the index '0' in a table.
- wheybags 5y ago> If you're accessing indexes directly you can have the index '0' in a table. Sure, you can, but in practice you won't. For example, something like `local pos = {x, y}`. You now have to use 1/2 to access the x and y coords. Making the same table with 0 indexing is awkward and not idiomatic.