Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> (Strangely, the 20th century is considered to have started Jan. 1, 1901 > it's not strange at all!

Are you a Lua programmer?



Wow, is Lua now the canonical example of a language that uses 1-origin indexing? No one remembers Fortran anymore? God I feel old...


Actually I just went here: http://en.wikipedia.org/wiki/Comparison_of_programming_langu...

sorted table by "Default base index" and at first picked FORTRAN, considered COBOL and Smalltalk for a while then saw Lua and thought that should resonate with people. My personal experience with 1 based indexing is from Matlab and Pascal (though you can base your indexes on whatever value you want there).


One of the few that people still care about!

Aside from BASIC, maybe.


Or Algol. Or Pascal. Or Smalltalk...


There is no Year 0. So the first century was Year 1 - Year 100, the second century was Year 101-200 etc.


"Year 1" was originally conceived as "the first year of our lord", which is one reason why there's no "zeroth year ...".

Now we're in the "two thousand and fifteenth year of our lord". Imagine all the off-by-one errors if years were zero-indexed.

Also, it wasn't until Fibonacci in 1200 or so before the western world developed a working relationship with zero.

But natural counting numbers are always 1-indexed anyway. The second dozen starts at 13. Bakers excepted, of course.


But measurement of a person's age is 0 indexed. It is a year after you are born that you are 1 year old.


Sure, but while you are 0, you are in your first year of life.


Natural counting isn't 1-indexed. You usually count things after you tally them, not before. (You don't start counting beans by saying "one bean" and then waiting for that bean to arrive.)

Besides, it is not all that clear if someone just says "Jan 1 marks year one" whether it marks the end of the first year or the beginning. With dates, it usually marks the beginning. That's why it is 1-indexed. We hardly count anything else that way, so why would you assume it is 'natural counting'?


So is Wikipedia (http://en.wikipedia.org/wiki/20th_century) wrong on this one? Seems like all other centuries are calculated correctly.


Yes it's wrong. According to that page and the one on the 21st century, the year 2000 didn't belong to any century. Oddly, the wrong statement is listed as having two citations.



As of right now it appears to be correct (1901-2000, inclusive).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: