5 ms·
Pascal had indexes starting at 1 too. Starting indexes at 0 makes sense when you want to enable the developer to manipulate memory (for example, C) Indexes st
by MiyamotoAkira 3y ago
Pascal had indexes starting at 1 too.
Starting indexes at 0 makes sense when you want to enable the developer to manipulate memory (for example, C)
Indexes starting at 1 matches with a more natural ordinal sequencing.
- haspok 3y ago> indexes starting at... "I don't understand the word 'index'". - a functional programmer
- selcuka 3y agoThe most evil was Visual Basic where you could configure the default starting index (OPTION BASE 1), leading to weird bugs when multiple people worked on the same codebase.
- itake 3y agoI don’t understand. Either your saying adding or removing elements to an array doesn’t manipulate memory, or you’re saying adding or removing elements in an array does manipulate memory, but the developer doesn’t care due to the GC. If it’s the second option, why has (almost) every other language chosen with a GC to start arrays with 0?