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

Programmer Humor

32562 readers
397 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] lefixxx@lemmy.world 120 points 2 months ago (5 children)

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

[–] jmcs@discuss.tchncs.de 45 points 2 months ago (7 children)

Your rulers start at 1? That sounds annoying.

[–] Godnroc@lemmy.world 20 points 2 months 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 23 points 2 months ago (1 children)

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

plastic ruler starting at 0 cm

[–] xthexder@l.sw0.com 22 points 2 months 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 8 points 2 months 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.

load more comments (1 replies)
[–] NateNate60@lemmy.world 19 points 2 months 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 10 points 2 months ago* (last edited 2 months 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."?

[–] spikespaz@programming.dev 9 points 2 months 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".

load more comments (1 replies)
load more comments (4 replies)
[–] Barbarian@sh.itjust.works 24 points 2 months ago (2 children)
[–] AngryCommieKender@lemmy.world 27 points 2 months 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 13 points 2 months 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 9 points 2 months 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?

load more comments (2 replies)
[–] psud@aussie.zone 9 points 2 months ago

Blame the restaurant for having a table identified as zero

[–] CanadaPlus@lemmy.sdf.org 8 points 2 months 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.

load more comments (1 replies)
[–] drunkpostdisaster@lemmy.world 66 points 2 months ago (3 children)

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.

load more comments (3 replies)
[–] pelya@lemmy.world 60 points 2 months ago (8 children)

In the UK it's called a ground table.

[–] AngryCommieKender@lemmy.world 20 points 2 months ago (1 children)

So it was a spelling mistake? They're actually The Knights of The Ground Table!

load more comments (1 replies)
load more comments (7 replies)
[–] aluminium@lemmy.world 58 points 2 months ago (2 children)

She was a lua girl, he was every other programming language guy. It was not ment to happen.

[–] tetris11@lemmy.ml 11 points 2 months ago

She liked embeddded apps
And he liked desktop displays
What more can I say?

[–] bob_lemon 10 points 2 months ago (3 children)

Hey, don't forget the Matlab people

load more comments (3 replies)
[–] netvor@lemmy.world 50 points 2 months ago (1 children)

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.

[–] Bishma@discuss.tchncs.de 36 points 2 months ago (1 children)

I love the idea that they're at two adjacent tables, each one staring at the other wondering why they hate them.

[–] KellysNokia@lemmy.world 8 points 2 months ago

They hate each other because they are intolerant to one another's index choices

[–] lustyargonian@lemm.ee 47 points 2 months ago (2 children)

If you love me meet me at first floor

Americans 😢 British 🤷‍♂️

[–] TriflingToad@lemmy.world 39 points 2 months ago (1 children)
load more comments (1 replies)
load more comments (1 replies)
[–] DarkDarkHouse@lemmy.sdf.org 45 points 2 months ago

It’s for the best

[–] yonder@sh.itjust.works 42 points 2 months ago (1 children)

That is why my restaurant will number tables by UUID.

[–] OneCardboardBox@lemmy.sdf.org 8 points 2 months ago

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

[–] iAvicenna@lemmy.world 35 points 2 months ago (3 children)

they were never meant to be together, they would confuse the hell out of each other. Imagine they have two kids and she says pick kid[1] from the school, then what?

[–] tetris11@lemmy.ml 17 points 2 months ago* (last edited 2 months ago) (1 children)
Child Overflow Error

Edit: oh wait you said two kids, nvm

load more comments (1 replies)
[–] TechieDamien@lemmy.ml 15 points 2 months ago

I think children go in dictionaries so you can look them to via name (key).

load more comments (1 replies)
[–] yesman@lemmy.world 29 points 2 months ago

The real punch line is that in a cafe run by programmers, esoteric rules are in full force, but tables 0 and 1 are no where near each other.

[–] PeriodicallyPedantic@lemmy.ca 27 points 2 months ago (4 children)

🙅 zeroth, first, second, third
👉 Zerost, onest, twost, threest

load more comments (4 replies)
[–] AnnaFrankfurter@lemmy.ml 26 points 2 months ago* (last edited 2 months ago) (2 children)

Hey, if she thinks 1 is 1st index then you ~~dogged~~ dodged a bullet and deserve better.

Happy now all you English majors.

[–] MadBob@feddit.nl 33 points 2 months ago

you dogged a bullet

😳

load more comments (1 replies)
[–] sasquash@sopuli.xyz 25 points 2 months ago

maybe she's a lua developer

[–] LillyPip@lemmy.ca 17 points 2 months ago (2 children)
load more comments (2 replies)
[–] sgibson5150@slrpnk.net 17 points 2 months ago (4 children)

Wouldn't it be nice if documentation used the words index and offset consistently?

[–] dohpaz42@lemmy.world 10 points 2 months ago (5 children)

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.

load more comments (5 replies)
load more comments (3 replies)
[–] Lettuceeatlettuce@lemmy.ml 15 points 2 months ago

I still mess this up for lists in Python...

[–] coffee_with_cream@sh.itjust.works 13 points 2 months ago

This would work better as Nth floor of a building

[–] Chev@lemmy.world 13 points 2 months ago (1 children)

1st table is not equal to table 01 because there no 0st table

load more comments (1 replies)
[–] Zwiebel 10 points 2 months ago (1 children)

I love how they're looking at each other

load more comments (1 replies)
[–] JohnDClay@sh.itjust.works 9 points 2 months ago (2 children)

Isn't the guy at the zeroith table?

[–] TwilightKiddy@programming.dev 28 points 2 months ago* (last edited 2 months ago) (11 children)

There is no such thing as "zeroith". Does not matter which numbers you slap on the tables, the one with the lowest number will always be the first. The word "first" has nothing to do with indices, it's just an antonym for "last".

load more comments (11 replies)
load more comments (1 replies)
[–] BlindFrog@lemmy.world 9 points 2 months ago

IS THIS Love Advice From the Great Duke of Hell??

(it's a webcomic, I loved the story)

[–] NigelFrobisher@aussie.zone 8 points 2 months ago

This thread is a great example of why they don’t like to let (most) software developers talk to the customers.

load more comments
view more: next ›