this post was submitted on 13 Jan 2026
84 points (88.9% liked)

Programmer Humor

28409 readers
1554 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
[–] dnick@sh.itjust.works -1 points 1 day ago (1 children)

Maybe it's just worse when written. The period at the end of the sentence makes it hard to see how it could be misunderstood.

To your point though, not sure if I'm aware of any programming language that would continue a statement with a following if block. Far more likely that it would fail due to lack of an element to apply the 6 to rather than having a pointer to the previous object, or he would try getting what ever the literal version of a 6 would be, or maybe some slang version.

[–] ignirtoq@feddit.online 2 points 1 day ago

Python, though the logic would be backwards:

milk_gallons = 6 if eggs > 0 else 1