3 ms·
Fun fact about this: Lua is embedded in MediaWiki (the software that runs Wikipedia and also a lot of other wikis). And in MediaWiki template variables are also
by RheingoldRiver 4y ago
Fun fact about this: Lua is embedded in MediaWiki (the software that runs Wikipedia and also a lot of other wikis). And in MediaWiki template variables are also 1-indexed (no comment on this particular design choice). So the 1-based indexing of Lua becomes an utterly fantastic feature not just because it's convenient but also because a lot of people writing code are super new to programming, and any barrier to entry (like having to shift your indices when you go from the template to the module you're invoking) would potentially stop someone from writing any code at all in the first place.
So for this one use case at least, the 1-based indexing is pretty nice.