Zero-based ordinals

This is the televenth post of my blog.

by on

Many programming languages use Zero-Based Indexing for referring to the elements of a list. There are a number of strong technical reasons why this is convenient, but I won’t be talking about them this article.

Oftentimes, when discussing zero-based indexing it is useful to refer to the element at the start of the collection as the “zeroth” element, as an analogy to the ordinal “first” in one-based numbering. This serves as a reminder that we’re talking about the element at the start, and not the element at position one, which could ambiguously also be referred to as the first. The word zeroth can be used in computer documentation to be rigorously unambiguous.

Because of Benford’s Law of Numbers, the use case for the zero-based ordinals numbering beyond one don’t come up much. You’re much more likely to care about the zeroth element than the element at position 2,235, or ever position 6.

There is ambiguity, however, whenever you want to refer to the element in the next positions. If, in natural speech, you said to make a tuple of the zeroth and the first element of an array, would your listener be able to understand whether you mean, arr[0], arr[0], or arr[0] arr[1]?

To disambiguate this, I think we have an opportunity to propose names for them. I humbly submit:

  1. Zeroth
  2. Firstend
  3. Secord
  4. Thirth
  5. Fourfth
  6. Fixth
  7. Sixenth
  8. Seventh
  9. Eighnth
  10. Nenth
  11. and Televenth

The way in which I generated the ordinal names for every number n other than zero was to take the prefix associated with ord(n), but the suffix associated with ord(n + 1).

Thus, First + Second = Firstend.

Applying this same rule to the zeroth element would make it the zerost, but since that ordinal has already be accepted due to custom and prior usage, I’m not looking to change it.

I’m appealing to Benford’s law again, to justify leaving the numbers beyond the televenth to a future discoverer.

Other articles you may like

This article was filed under:
Programming Silly