Re:Python 1.0.0 is out (1994)
by e12e on Saturday January 27, 2018 @01:50PM
(#16247444)
I am in the odd situation that from habit collection[0] feels natural - but I actually think "first element" makes a lot more sense than "item at zero offset".
Except maybe for things that are actually pointer+offset (which I think very rarely makes sense in high level languages/most ADTs).
In fact, I think for situations where 0-based indexing makes sense, I'd prefer "memory_area+offset" rather than "pretend_collection_type[offset]".
I also usually talk about "the first character" of a string, or first word of a sentence; not "word at zero offset from start".
So yeah, I think Dijkstra's wrong on this one (or rather he has some very strong opinions on greater-/less-/-and-equal-to, and which are natural - for which I have little sympathy outside of abstract discrete math papers).
Except maybe for things that are actually pointer+offset (which I think very rarely makes sense in high level languages/most ADTs).
In fact, I think for situations where 0-based indexing makes sense, I'd prefer "memory_area+offset" rather than "pretend_collection_type[offset]".
I also usually talk about "the first character" of a string, or first word of a sentence; not "word at zero offset from start".
So yeah, I think Dijkstra's wrong on this one (or rather he has some very strong opinions on greater-/less-/-and-equal-to, and which are natural - for which I have little sympathy outside of abstract discrete math papers).
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...