Hacker News new | past | comments | ask | show | jobs | submit login
Why numbering should start at 0 – Edsger Dijkstra [pdf] (utexas.edu)
4 points by thunderbong 4 months ago | hide | past | favorite | 1 comment



Counting also starts at 0. The reason many people believe it to start at 1 is due to them calling out counts only post-increment.

For instance, if during a car ride you play a game of counting the number of pink cars you see along the way, then you start with a count of 0 in your mind (although you may call it "I haven't seen any" instead). And only when you see a pink car will you exclaim "1". But you may never see that pink car and still be left with a final count of 0.

So instead of saying counting starts at 1, it's more accurate to say that post-increment counts start at 1.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: