4 ms·
It depends on what you're using the indexing for. Having played around with Lua (In a mod for Minecraft, of all things), I'll say that 1-based indexing is bett
by TheLoneWolfling 12y ago
It depends on what you're using the indexing for.
Having played around with Lua (In a mod for Minecraft, of all things), I'll say that 1-based indexing is better for some things, while zero-based indexing is good for other things.
One of the nice things about 1-based indexing is that for basic "display a list to the user with indexes" purposes, you don't need to add one all over the place. But at the same time with 0-based indexing you don't need to check the lower bound in a lot of cases.