Live data from Hacker News

Numbering Should Start at Zero

cs.utexas.edu

21–30 of 58 posts

Re: Numbering Should Start at Zero

#22
post #19

Earlier quoted context omitted.

This reminds me of when I used zeroeth, oneth, twoth, and threeth, instead of first, second, and third, for referring to indices 0, 1, 2, and 3 as a TA. It's less verbose than “at index zero”, but feels a little clumsy.

Zeroth is an actual word, I heard it many times in conversation between methematicians.

[deleted]

Re: Numbering Should Start at Zero

#23
post #19

Earlier quoted context omitted.

This reminds me of when I used zeroeth, oneth, twoth, and threeth, instead of first, second, and third, for referring to indices 0, 1, 2, and 3 as a TA. It's less verbose than “at index zero”, but feels a little clumsy.

Zeroth is an actual word, I heard it many times in conversation between methematicians.

Sure but then what do you call the subsequent items?

Re: Numbering Should Start at Zero

#25
post #6

I always found array index confusing. For example, given a array with size N in Python, we can iterate it from 0 to N-1 (onwards) and from -1 to -N (backwards), which is not consistent at all. Programming language is meant for human eyes. It would be better if array index being 1 to N, and let the compiler substract that 1 for us.

One idea is a programming language that allows both, with different syntax. Say A[i] for 0 based and A{i} for 1 based.

Re: Numbering Should Start at Zero

#28
Dijkstra have a certain way of writing as if his argument follows by logical necessity. But when you dig into the chain of reasoning, it hinges on the assertion that starting with 0 is "nicer". Which is of course a valid opinion, but starting with 1 also have nice properties, for example that the numbering of elements corresponds to the ordinal numbers. Having the first element be element 1 is pretty nice IMHO.

He ends with the assertion "In corporate religions as in others, the heretic must be cast out not because of the probability that he is wrong but because of the possibility that he is right." This sounds profound and edgy but is just an appeal to contrarians which can be used to justify absolutely anything. You criticize my theory X, that just shows how right I am! And anyway, isn't the "corporate religion" these days to start with 0, since this as what the big mainstream languages does?

Re: Numbering Should Start at Zero

#29
post #27

Earlier quoted context omitted.

Sure but then what do you call the subsequent items?

first, second and so on

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.

Re: Numbering Should Start at Zero

#30
I don't know about arrays, but numbering floors starting from 1 is absurd.

In most of Europe ground floor is 0, underground floors are negative, floors above the ground are positive numbers.

Integers were invented for a reason, use them :)

Post reply on HN