Hacker News new | ask | show | jobs
by xigoi 1452 days ago
Indexing starts at 1 in math mostly because in history, people were afraid of 0, and it's hard to change conventions.
1 comments

Debatable. It makes sense to say "the first element", regardless of mathematical connotations. We've had this kind of expression in almost every language across the world long before we invented multiplication.

Saying the "the zeroth element" is just... weird and slightly nonsensical.

Yes, because language developed at a time where people didn't know about zero.
Zero still would most likely wooldn't make sense. Zero is nothing, it can't be anything. Even ordinally.

1 is something and it fits very well for the first position... outside of programming :-)

In 1-based indexing, the index of an item is the number of items you've already seen, including the one you're looking at.

In 0-based indexing, the index of an item is the number of items you've already seen, excluding the one you're looking at.