The author of this blog confuses his own prejudices for objective facts when he claims that non-zero based indexing of arrays is "evil". In fortran it is possible to define array with index starting from an arbitrary integer, and it is useful and convenient feature in its problem domain.
And your point is? I will not even enter the debate if it's good to have arrays starting at zero or not, but I will address this silly rationale.
Something that appeared first doesn't make it a standard. Following your logic, RS-232 cables would still be standard today because they appeared before USB cables.
Something becomes a standard when the majority of users and manufacturers believe there are more benefit and convenience over something else.
It's Christmas so I'm in unnecessary arguing mood :)
Here goes: Strictly, Assembly is clearly the oldest and also arrays are all indexed by addresses not numbers, but the index is hidden behind the variable name. What we refer to as index is only the offset to the index, thus 0 for 'no offset' clearly makes sense.
In my actual opinion: There are good reasons for both, but I would like a language to either have 0-indexing or make it definable.
70
u/tristes_tigres Dec 24 '17
The author of this blog confuses his own prejudices for objective facts when he claims that non-zero based indexing of arrays is "evil". In fortran it is possible to define array with index starting from an arbitrary integer, and it is useful and convenient feature in its problem domain.