start arrays at 0 or 1
Posted on 2004-11-18
0 or 1 is the question.
Arrays in C++ start at 0.
However, sometimes it is more convenient to start them at 1.
For example, if I am to model a chess board as an array, I feel it is more convenient to number rows and columns between 1 and 8, rather than between 0 and 7.
If I have 3 items of something, I'd rather count them 1,2,3, instead of 0,1,2.
Hence, the question: is this a matter of taste, or are there practical ways when you do need to use 0, or to use 1.
Just to note: there are some things that are a matter of taste, but then someone comes up with a good reason to use one of those things and not the others. That's why I'm asking.
If I get a really good reason or a really good reply, I will increase points before awarding points.