If you love me meet me at first floor
Americans 😢 British 🤷♂️
Also the plot of Before Sunset 🏆
🙅 zeroth, first, second, third
👉 Zerost, onest, twost, threestBullshit.
Every programmer knows that
'A'
in['A', 'B', 'C', 'D']
would be the 0th item; the first item is'B'
That would be wrong in every technical sense. You’re saying that
.first()
would skip the 0th item.First = leftmost.
That’s because the word “first” in
first()
uses one-based indexing. In true programmer fashion it would have been calledzeroth()
but that is wholly unintuitive to most humans.I maintain that the element with the lowest index is called the “zeroth” element in zero-based indexing and “first” in one-based indexing. The element with index N is the Nth element.
Most humans wouldd never write the word
first
followed by()
. It absolutely should have beenzeroth()
, and would not cause any confusion amongst anyone who needed to write it.It absolutely should not have been named zeroth() because the reasoning for that is purely pedantic and ignores WHY arrays are 0 indexed. It’s not like the people in the early days of writing programming languages were saying “the zeroth item in the array” - they would refer to it using human language because they are humans, not machines. Arrays are 0 indexed because it’s more efficient for address location. To get the location in memory of an array item, it’s startingAddress + (objectSize * index). If they were 1 indexed, the machine would have to reverse the offset.
Function/Method names, on the other hand, should be written so as to make the most sense to the humans reading and writing the code, because the humans are the only ones that care what the name is. When you have an array or list, it’s intuitive to think “I want the first thing in the array” or “I want the last thing in the array),” so it makes sense to use first and last. That also makes them intuitive counterparts (what would be the intuitive counterpart to “zeroth”?).Function/Method names, on the other hand, should be written so as to make the most sense to the humans reading and writing the code
Of course—that’s why we have such classics as
stristr()
,strpbrk()
, andstripos()
. Pretty obvious what the differences are there.But to your point, the ‘intuitive’ counterpart to ‘zeroth’ is the item with index zero. What we have is a mishmash of accurate and colloquial terms for the same thing.
My argument is purely pedantic. Pedantry is the lifeblood of programmer “humour”.
I’m not arguing that we should adopt zero-based numberingin real-life human applications. I am arguing that in zero-based numbering, the label “zeroth” refers to the same ordinal as “first” in one-based numbering. I am poking fun at the conversion between human one-based numbering and computers’ zero-based numbering. That is why I am saying it should be called
zeroth()
; because human language should adapt to match the zero-based numbering their tools use. Whether I actually mean what I say—well, I leave that up to you.It does not matter why indexes start from zero in computing. The memory offset argument is only salient if you are using it as an argument for why computers should use zero-based numbering. It is not an argument against the properties of zero-based numbering itself.
No, there is simply no such thing as “zeroth”, that’s not how ordinal numbers work. If I have the following numbered list:
-
Foo
-
Bar
-
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.
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.
-
Indexes start from zero because they’re memory offsets, but
array[0]
is still the first element because it’s an ordinal number, not an offset. It’s literally counting each element of the array. It lines up with the cardinality—you wouldn’t say['A', 'B', 'C']
has two elements, despitearray[2]
being the last element.Zero-based indexing redefines the meaning of the labels “first”, “second”, “third”, and so on. It adds a new label, “zeroth”, which has the same ordinal value as “first” in one-based indexing. The word “first” does not mean “the element with the lowest index” in zero-based indexing.
If you are using a zero-based numbering system, you would absolutely say that
array[2]
is the final element in the array, that element having the ordinal label “second”, and yet the length of the array is 3 (cardinal). There is no fundamental connection between the ordinal labels “zeroth”, “first”, “second”, and “third” and the cardinal numbers 0, 1, 2, and 3. The similarities are purely an artefact of human language, which is arbitrary anyway. You can make an equally mathematically valid ordinal numbering system that assigns “third” to the element with the smallest index, “fourth” to the next-smallest, and so on. That ordinal numbering system is mathematically coherent and valid, but you’re just causing trouble for yourself when it comes time to convert those ordinals (such as array indexes) into cardinals (such as memory locations or lengths of fencing to buy).You can make an argument for why one-based numbering is more convenient and easier to use, but you cannot use the notion that zero-based numbering doesn’t make sense given the assumed context of one-based numbering as an argument for why zero-based numbering is invalid.
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.
It does not matter why indexes start from zero. The memory offset argument is only salient if you are using it as an argument for why computers should use zero-based numbering.
1st would be ‘B’, first is ‘A’
DROP TABLE 01;
Dangit Bobby!
Wouldn’t it be nice if documentation used the words index and offset consistently?
Aren’t those two the same thing? At least in C-style arrays, which might not be how they’re handled under the hood, but is at least how most languages present it to the programmer.
in my understanding offset is technically the “relative index”, or how much you have to go further
Yes they are presented in the programmer wrong. The first thing in memory should have offset 0 and index 1
The problem is that they both are contextual and can mean any position in a list/array. The starting index or starting offset is generally zero, but could be one, depending on the language used.
i wonder why people haven’t made a language that starts indexing at 2 yet. maybe some day
Maybe this could be a feature in brainfuck or COBOL.
god i hope so
What more can I say
Why the fuck would you spell it “1st” if it’s not 1?
Edit: Which is not pronounced “onest”. I think people might be missing the point here; I’m actually a fan of zero indexing.
I feel like the joke would’ve landed better if it said “first”. I know it’s pronounced the same way, but I’m gonna argue anyway that there’s a subtle difference. I’ve heard 0th used in cs to describe what was at the 0-index, so in that context 1st would be"second", but “first” generally means “nothing before it”. English is weird. I wonder if anyone knows whether the word “first” or “1st” came 1st (lol)?
Ordinal vs. cardinal. It’s “first” not “onest”, right? Even the ancient proto-Germanic speakers could tell there’s a difference. (In fact, it’s basically a contraction of “foremost”, and has nothing to do with numbers; their weak numeracy was an advantage on this topic)
If we weren’t implicitly choosing 1-indexing it would be 1nd for “second” (and still not “onend” or something). That breaks down once you get to third and fourth, though.
She is right, using 0 index for physical stuff is stupid.
Your rulers start at 1? That sounds annoying.
Your job is to move apples from one bin to another. You pick up the first one and set it in the other bin, and say “zero.”?
There’s another way to think about it which I actually use. Look in the empty bin and say “zero”, then move an apple and say “one”.
I’ve seen a lot of rulers that actually don’t have a mark at 0 and instead go right to the edge as 0. Typically they are worn down, being made of wood, so the accuracy of the first inch is dubious. To ensure the distance is correct, sliding the ruler down one unit is a good idea. So, my ruler starts at 0 but my measurements start at 1.
That’s why decent rulers have a 0 and a margin:
It really depends on what you’re measuring. Good luck measuring the distance from a corner if you can’t get 0 to touch the end.
Tape measures are almost always designed with this in mind, so you can hook the end over an edge, or butt it up against something and the measurement will be accurate both ways, since the metal end can slide in or out by just the right amount.
since the metal end can slide in or out by just the right amount.
OMG! I genuinely thought all the tape measures I have handled were a little broken.
Just shave down the rulers margin!
Rulers measure cardinal quantities and not ordinal ones. There is no cardinal numbering scheme that starts at 1, all of them “start” at 0. For ordinal numbering schemes, the symbols are arbitrary anyway and you can start with whatever you want. It’s equally valid to start with 1, 0, -1, A, or “aardvark”. The only benefit to picking 1 as the start is to make it easier to count with your fingers while picking 0 lets you easily convert an ordinal quantity to a cardinal one.
Works for floors!
Not on this side of the pond. We typically don’t have a ground floor, that’s just the first floor.
i wish the people making buildings around here knew that. some start at floor 3, others at 5. some start at 0. others at 2. every building has its own story. you need to understand the building before you can understand your position in it.
if a building is built into a hillside in the uk and has exits on floors 2 and 5, which would be the ground floor?
My intuition would be floor 2, as it is the lowest floor to the ground that isn’t underground
it’s floor 5 from monday to wednesday, and floor 2 from thursday to sunday
Why? It seems exactly as valid to me, and more valid if you like positional numberings of your physical stuff.
You just count the number of times you departed from an item in order, rather than the times you arrived.
It’s for the best
In the UK it’s called a ground table.
So it was a spelling mistake? They’re actually The Knights of The Ground Table!
They dance whenever they’re gable?
do you also have minced tables there?
When you get off an airplane, do you say
“Its great to be back on solid first floor of the earth.”
?
If the walkway goes inside the building, then yes. And the walkway usually leads directly to the second floor, because the airplane door is 3 metres above the ground.
Don’t wanna state the obvious, but it looks like they still ended up staring at each other for the rest of the evening.
They have shown that they still love each other, so hope they can work with their one irreconcilable difference.
I love the idea that they’re at two adjacent tables, each one staring at the other wondering why they hate them.
They hate each other because they are intolerant to one another’s index choices
And then he texts back ‘where are you?’ And then she texts back ‘the first table’ and he replies ‘umm I’m here too. But I don’t see you’ confused she asks him ’ table 0p?’ And then ‘01*?’ He says ‘no, 00.’ Releaved she says ‘lol I am at table 01’ he chuckles ‘I am at 00, I’ll go find you’
Later they get married and have kids. But relationship collapses and it ruins both of them and they cannot find the heart to love anyone again. Their children grow up broken and struggle through life. Some get arrested end up in prison, all of them repeatedly fall into a series of toxic relationships for the rest of their lives.
That is why my restaurant will number tables by UUID.
A much better idea than when I tried to organize my restaurant with hashtables.
It was too much for the waitstaff, who had to reindex the floor plan every time they added or removed a plate.
On the plus side, delivering the right food was always O(1).
maybe she’s a lua developer