Hacker News new | ask | show | jobs
by afiori 1061 days ago
first, second and so on
1 comments

So the 'first' item in the list is actually the second?

The problem is you're trying to redefine English (and probably most other languages). The first item on a menu is, well the first item, like first place in a marathon, the first day of the month.

Surely a definition of the zeroth item would be something like an item that does not exist, the item that's left when you take away all the other items, etc.

Ordinals are 1-indexed. Language is 1-indexed; The #1 player is the best player, and so on.

zeroth is the ordinal associated with the cardinal zero.

For example christmas is the zeroth day after christmas.

A common advice with regards to user inputs is that if you do not do ordering or arithmetic on a piece of data (eg a phone numbers) then it should be a string even if it is numeric.

Similarly n-indexed conventions should be considered in terms of practical pros and cons.

Linguistic similarity is not a convincing argument to me.

'associated'? Sounds nice, but not very convincing, except perhaps the zeroth item of an ordered set should be just that, 0.

I agree indexing is a trade-off, sometimes 0 is best, sometimes 1 makes more sense.

But it's not linguistic 'similarity'. You have to name things. If your names are off-by-one (the element named 'first' is actually the second) you're just sowing confusion.

sometime ordinals are more natural sometimes cardinals are more natural.

In the case of vectors (especially of C-style arrays) I would say that A[0] is the first element in the array. I agree that things should have names, but names serve us, not us them.