I learned C and Unix in the 80s, and it was Just Obvious that 0-based counting was the right answer for this kind of data. It wasn’t justified or questioned, being clearly the right way to think.
And it IS obvious for things that get used as indices into arrays (monthname, dayname, etc.), and confusing that it’s NOT universal—day of month is 1-indexed.
Nowadays, it’s probably like the semi-apocryphal causal chain from Roman chariots to 18th century rail width to modern solid rocket booster diameter. Keeps getting repeated for compatibility and because it’s not clearly worse than alternatives.
Related to these kinds of details that are not obvious, but just need to be understood, my only Y2K bug was due to the fact that the older time struct used “years since 1900” as the year value, and I had a few pages that displayed “Jan 1 19100″ until I fixed them to be 1900 + $year instead of “19” + $year.
I learned C and Unix in the 80s, and it was Just Obvious that 0-based counting was the right answer for this kind of data. It wasn’t justified or questioned, being clearly the right way to think.
And it IS obvious for things that get used as indices into arrays (monthname, dayname, etc.), and confusing that it’s NOT universal—day of month is 1-indexed.
Nowadays, it’s probably like the semi-apocryphal causal chain from Roman chariots to 18th century rail width to modern solid rocket booster diameter. Keeps getting repeated for compatibility and because it’s not clearly worse than alternatives.
Related to these kinds of details that are not obvious, but just need to be understood, my only Y2K bug was due to the fact that the older time struct used “years since 1900” as the year value, and I had a few pages that displayed “Jan 1 19100″ until I fixed them to be 1900 + $year instead of “19” + $year.