Martin Hepperle
Experienced Member
- Joined
- Nov 10, 2014
- Messages
- 135
0th I have to say that this is probably a matter of taste or reference system.
1st computers add the offset to the array address, so 0-based indices make perfect sense under the hood.
2nd I think that for humans it is more logical to start with a one (at kleast for us 10-fingered mammals).
In the end, it is always a nice source for errors and that's what counts ;-)
BTW: some programming languages allow defining arrays with arbitrary start and end index ranges (e.g. Fortran) and even in BASIC we have OPTION BAE 0|1.
1st computers add the offset to the array address, so 0-based indices make perfect sense under the hood.
2nd I think that for humans it is more logical to start with a one (at kleast for us 10-fingered mammals).
In the end, it is always a nice source for errors and that's what counts ;-)
BTW: some programming languages allow defining arrays with arbitrary start and end index ranges (e.g. Fortran) and even in BASIC we have OPTION BAE 0|1.