4 ms·
The indexing starting at 1 is something that has always annoyed me. I just haven't seen any other language make that decision, and I'm not sure the reasoning fo
by sporedro 5y ago
The indexing starting at 1 is something that has always annoyed me. I just haven't seen any other language make that decision, and I'm not sure the reasoning for it really outweighs the fact every other language just goes with 0 due to the origin of it.
Lua is a great language for sure though.
- fullstop 5y agoPascal did, but I believe that was because index 0 contained an 8-bit length. There was no need for null termination, and strings were limited to 255 bytes.
- mattkrause 5y agoFortran, Matlab, and Julia all start arrays at 1, either always (Matlab) or by default (Fortran, Julia).
- toast0 5y agoErlang indexes starting at one, except when it doesn't. Tuples are 1 indexed, lists are 1 indexed (in the standard library, anyway), but binaries are zero indexed.