this post was submitted on 19 Sep 2024
1021 points (98.6% liked)

Programmer Humor

32050 readers
1800 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
[–] lefixxx@lemmy.world 84 points 13 hours ago (3 children)

She is right, using 0 index for physical stuff is stupid.

[–] jmcs@discuss.tchncs.de 19 points 11 hours ago (3 children)

Your rulers start at 1? That sounds annoying.

[–] NateNate60@lemmy.world 6 points 7 hours ago

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.

[–] gallopingsnail@lemmy.sdf.org 4 points 7 hours ago* (last edited 7 hours ago) (2 children)

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."?

[–] absGeekNZ@lemmy.nz 4 points 4 hours ago

When playing games with the kids, we start at 0 being the position you are currently in, then count from there.

e.g. in snakes and ladders, if you are on spot 30 and roll a 5, tap spot 30 and say "zero", then spot 31 is "one" etc.. till you are at spot 35 saying "five".

Teaches the kids about zero and avoids miss counts from the younger ones counting their current position as "one"

[–] spikespaz@programming.dev 6 points 7 hours ago

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".

[–] Godnroc@lemmy.world 12 points 10 hours ago (1 children)

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.

[–] jmcs@discuss.tchncs.de 11 points 10 hours ago (1 children)

That's why decent rulers have a 0 and a margin:

plastic ruler starting at 0 cm

[–] xthexder@l.sw0.com 16 points 9 hours ago (2 children)

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.

[–] june@lemmy.dbzer0.com 4 points 6 hours ago

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.

[–] kurwa@lemmy.world 5 points 9 hours ago

Just shave down the rulers margin!

[–] Barbarian@sh.itjust.works 20 points 12 hours ago (2 children)
[–] AngryCommieKender@lemmy.world 22 points 12 hours ago

Not on this side of the pond. We typically don't have a ground floor, that's just the first floor.

[–] affiliate@lemmy.world 11 points 11 hours ago (1 children)

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.

[–] HeyThisIsntTheYMCA@lemmy.world 7 points 8 hours ago (2 children)

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?

[–] june@lemmy.dbzer0.com 3 points 6 hours ago

My intuition would be floor 2, as it is the lowest floor to the ground that isn't underground

[–] affiliate@lemmy.world 3 points 7 hours ago

it’s floor 5 from monday to wednesday, and floor 2 from thursday to sunday

[–] CanadaPlus@lemmy.sdf.org 8 points 12 hours ago

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.