2 ms·
To put this another way; as mentioned by the fence post example another poster above mentioned. If you label the fence posts with numbers, from 1 to N, the val
by mjevans 11y ago
To put this another way; as mentioned by the fence post example another poster above mentioned.
If you label the fence posts with numbers, from 1 to N, the value at a given address along the length of the fence is the distance from the start of the fence.
In this case 0 posts from the start is the value 1. What makes this confusing is the arbitrary choice of the value of the object at location 0. Dijkstra does a reasonable job of explaining why logically beginning numbering at 0 makes sense for the index/address, but does not reasonably explain that the fault in the logic of those whom would count an item is failing to use that logically derived index/address as the identity of the object.
That is, the numeric id of the object at address 0 should also be 0, not 1, as many assume it should be based on the conventions that were instilled in basic education.