this post was submitted on 13 Jan 2026
122 points (89.6% liked)

Programmer Humor

28863 readers
1325 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

A wife tells her programmer husband: β€œGo to the store and buy a gallon of milk. If they have eggs, get six.”

He comes back with six gallons of milk. When she asks why, he replies: β€œThey had eggs".

you are viewing a single comment's thread
view the rest of the comments
[–] rockerface@lemmy.cafe 66 points 2 weeks ago (2 children)

The joke is bad because the husband is supposed to bring seven gallons of milk. Since the egg condition is checked after he already got one.

[–] NaibofTabr@infosec.pub 18 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

No no, the imperative "get six" overrides the previous "buy a gallon of milk" if the "they have eggs" condition is met.

"get six" implies x === 6 not x = x + 6, that would be "get six more"

The real problem is that "buy" was only specified in the first case. Because the conditional was met, he should get six gallons of milk but not buy them.

[–] ulterno@programming.dev 3 points 2 weeks ago (1 children)

Now just how did he procure the rest of the 5, is a mystery.

[–] mech@feddit.org 1 points 2 weeks ago* (last edited 2 weeks ago)

He cloned the supermarket.

Omg, you’re so right. I didn’t read it that way until you pointed that out.