| The visuals are definitely valuable in explaining this. It used to be popular, and still is in some circles, to debate whether programming languages ought start array indexing at 0 or 1. When talking about this with other programmers, I've discovered that a lot of the issues/confusion could be avoided by consistent use of terminology: Offsets/offsetting always being zero-based and indexes/indexing always being one-based. Using rulers and birthdays also helps to explain differences. You're in the first year before your first birthday, being zero (whole) years old. To make matters potentially more confusing, culturally, I remember something about the ground floor in the UK buildings not being "Floor 1" like it is in the United States. http://www.hacker-dictionary.com/terms/fencepost-error |
Of course, it's the offset from the first element, so it's kind of a circular definition.