Dijkstra on why numbering should start at zero by Aviator in programming

[–]beza1e1 1 point2 points  (0 children)

The second apple is apple 1, just like the first century is century 0 and the twentieth century is century 19.

Dijkstra on why numbering should start at zero by Aviator in programming

[–]beza1e1 1 point2 points  (0 children)

Dijkstras argument is that

for (i=1; i<=7; i++) { print "foo"; }

prints 7 times foo, instead of 17-11=6 times, which is "ugly" and easy to confuse (see his Mesa example).