3 ms·
Why Python uses 0-based indexing
- downerending 7y agoBetter than nothing, but best to just read Dijkstra's article on the subject. (Spoiler: Because zero-based indexing is dramatically better than any alternative.)
- AnimalMuppet 7y agoThe spoiler would be a bit better with some hint as to why Dijkstra said zero-based was dramatically better.
- downerending 7y agoThe note is here and just one-page. You should read it. But, I'd summarize as zero-based indexing and its partner half-open intervals are a win for simplicity and reliability of code and thinking in general. https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...