r/computerscience • u/Dry-Establishment294 • Apr 02 '25
Counting from 0
When did this become a thing?
Just curious because, surprisingly, it's apparently still up for debate
0
Upvotes
r/computerscience • u/Dry-Establishment294 • Apr 02 '25
When did this become a thing?
Just curious because, surprisingly, it's apparently still up for debate
View all comments
Show parent comment
2
u/zouxlol Apr 02 '25
Right, you are very close. The index is a measure of "how far" and not an order at all. It will help alot to not try and apply ordering of objects here greatly. Use the ruler as "distance to travel" instead of measuring the size of something
It starts at 0 because the beginning of an array of inch-sized objects is "0 inches" away from the start, at index [0]. The second object in the inch sized object list is "1 inch" from the start, so it will be at index [1]