News for hackers. Stuff that matters.
Re:Show HN: MicroLua – Lua for the RP2040 Microcontroller by jecel on Saturday November 04, 2023 @04:23PM (#38144760)
Normally education or human oriented languages start arrays at 1 (Smalltalk, Cobol, Lua, APL, Wolfram, etc) while hardware oriented languages start arrays at 0 (C and friends, Oberon, Forth, Scheme and so on). Human oriented languages that have to play nice with C also tend to use 0. As do Python and Basic, which contradicts my rule.

Probably the number one reason not to start arrays at 0 in an educational language is that having the last element of an array of size 10 have an index of 9 causes quite a bit of confusion.

There are no comments on this comment yet.