7 ms·
I always thought it neatly mimicked the way we think of age. When you are born you start at 0. You only turn 1 after you have lived a year.
by groundCode 8y ago
I always thought it neatly mimicked the way we think of age. When you are born you start at 0. You only turn 1 after you have lived a year.
- smt88 8y agoThat's an argument for starting at 1, not at 0. At age 0, you have no elements in your array of years. So the first year is also element 1. If you want code to reflect the way you've done counting and arithmetic your whole life, you'd want it to start at 1.
- crangos 8y agoThat would be defining it as a time span and using the time since start as index. Which to me is one step away from using the timepoint as the index iteself (zero as start), verus (1 year from zero). How would you index the time before the first birthday?
- smt88 8y agoInsofar as a timespan is the same as counting years, then yes. If elements in the array are years, then the time before your first birthday doesn't appear.