Hacker News new | past | comments | ask | show | jobs | submit login

> months are often referred to by their ordinal number

What do you mean by “often”? Humans always use ordinal numbers for counting things like months, days, weeks, etc. There is no concept of 0 to be applied here, except for programming array indexing purposes.




Lay people indicate the month with an ordinal all the time since it's how dates are standardized (12/30/2021). People don't often indicate the day of the week with a number, they use "Monday" or "Tuesday". So there's no strongly held convention in people's minds about how to number days like there is for months.


It is lifted from C's struct tm. If you're maintaining tables of month names you're going to 0-index them so tm_mon is 0-based to facilitate that.


What I mean is that people use the ordinal number as the name of the month (as well as the day of the month). If you ask someone their birthday they’ll often say something like “five twenty, nineteen eighty-four.”

This is a potential cause for confusion when writing computer code, because it’s very common for code to refer to items in a collection starting at zero.


Side note regarding humans: I was in a hotel in France that referred to the ground floor as "floor zero" in their elevator. The only time I've ever seen zero used to count something IRL.


This is actually a decent way to demonstrate why zero-indexing for arrays makes sense. If your friend gives you instructions to their apartment “go to the elevator in the lobby and go up 3 floors,” which button do you press in the elevator?


I don’t follow? Even in your specific example, it would be +3 to whatever floor the elevator says you’re currently on. Though, usually people refer to the exact floor number per the elevator signs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: