this post was submitted on 19 Sep 2024
1001 points (98.5% liked)

Programmer Humor

32047 readers
1534 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 6 points 4 hours ago (1 children)

No, there is simply no such thing as "zeroth", that's not how ordinal numbers work. If I have the following numbered list:

  1. Foo

  2. Bar

  3. Baz

The first item is "Foo" which is indexed 5. It is not the fifth item, because the item indexed 5 comes first in the list, so the item indexed 5 is the first item. Ordinal numbers don't refer to index, they refer to order.

[โ€“] [email protected] 1 points 3 hours ago* (last edited 3 hours ago)

Okay, I will admit, you got me there. I did confuse indexing with numbering. From now on I will use the term "numbering" instead.

It is entirely how ordinal numbers work in zero-based numbering. There is no "right way" for ordinal numbers to work. You can create a valid ordinal numbering system starting from any integer, or just some other ordered list. You cannot assume one-based numbering is "correct" and use it as an argument against numbering beginning from any other number.

I encourage you read up what is meant by "zero based numbering" because you and everyone else who has replied to me has tried to use "but that's not how it works in one-based numbering" as an explanation for why I'm wrong. This is as nonsensical of an argument as trying to say i (the imaginary unit) is not a number because it's not on the number line. It's only not a number in the domain of the real numbers. Similarly, zero-based numbering is only nonsensical in the context of one-based indexing.

Zero-based numbering would number "foo" as the zeroth element, "bar" as the first element, and "baz" as the second element. "zeroth", "first", and "second" are labels representing ordinals. Your list has a length of 3 (which is a cardinal quantity unrelated to ordinals).

Although, I would like to point out, it is perfectly valid to construct an ordinal labelling system that assigns "fifth" to the element with the lowest index, "sixth" to the next, and so on. That system is mathematically coherent but it is just troublesome to when it comes time to convert ordinal numbers (such as the index of the last fence-post) to cardinal numbers (such as the length of fence to buy).

But this is now getting into the weeds of pure mathematics and most people here are engineers.