A software developer's wife asked him to get a gallon of milk from the store

"... and if they have eggs, get a dozen, " she added.

He later came home with 12 gallons of milk.

"Why'd you get so much milk!?!" his wife asked.

He replies, "THEY HAD EGGS!"

137 points · 26 comments · view on lemmy.world

26 Comments

Susaga@sh.itjust.works · 109 pts · 30d (3 replies)

Alternate version:

"While you're there, pick up some bread," she added. He never returned.

0xDREADBEEF@programming.dev · 18 pts · 30d (1 reply)

and when he returned empty-handed he answered "I then set the bread back down"

CalcProgrammer1@lemmy.today · 10 pts · 30d

Obviously someone else then took the bread, the only way to break the cycle.

MonkeMischief@lemmy.today · 7 pts · 30d

"Some say he's still there picking up bread to this day..."

HairyHarry@lemmy.world · 29 pts · 30d (4 replies)

"Buy two forks. Buy two forks for every fork you buy."

WhiskyTangoFoxtrot@lemmy.world · 22 pts · 30d (3 replies)

:(){ :|:& };:

HairyHarry@lemmy.world · 12 pts · 30d (1 reply)

Aahh, the ol' botox lips, raised monobrow, grumpy face and the two toothed irony wiking emoticons.

tetris11@feddit.uk · 1 pts · 30d

isn't this loss?

newton@feddit.online · 7 pts · 30d

This is old ,the forkbomb !

CallMeAl@piefed.zip · 29 pts · 31d (8 replies)

Should have gotten 13 gallons.

Oisteink@lemmy.world · 27 pts · 30d (6 replies)

No - he was asked to bring 1 or 12, not 1 and 12

CallMeAl@piefed.zip · 33 pts · 30d (4 replies)

try reading it again. Wife clearly says "and" not "or"

vinnymac@lemmy.world · 22 pts · 30d (3 replies)

The comma operator would like to have a word with you. I see a pause after eggs, 12 gallons it is

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator

CallMeAl@piefed.zip · 7 pts · 30d (2 replies)

Doesn't change it.

Wife adds 1 gallon of milk to shopping list;

Wife adds ( eggs, dozen) gallons of milk to shopping list;

Shopping list has 1 gallon and a dozen gallons for a total of 13 gallons.

vinnymac@lemmy.world · 10 pts · 30d

The shopping list doesn’t need to be additive, that’s just one way of interpreting what the wife wrote. There is no one correct way to read a joke as a program (my whole point), that is unless you write an interpreter for jokes :P

function getGallonOfMilk() {
  return 1;
}

function getDozen() {
  return 12;
}

const hasEggs = store.checkInventory(“eggs”);

const result = (
  getGallonOfMilk(),
  hasEggs && getDozen()
);

console.log(result * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛
GoatSynagogue@lemmy.world · 0 pts · 29d

1 gallon. If they have eggs, get a dozen.

If you take that as anything other than a dozen gallons, ie 12 gallons, you’re wrong.

4am@lemmy.zip · 1 pts · 30d

Found the BSAs

RacerX@lemmy.zip · 6 pts · 30d

I like the discussion in this thread.

Wilco@lemmy.zip · 8 pts · 30d

What? They apparently had eggs. If, then, else.

Codpiece@feddit.uk · 6 pts · 31d

Requirements unclear.

AlteE@programming.dev · 2 pts · 31d (5 replies)

I still don't understand why he managed to get 12 gallons and not 11 or even 10.

unitedwithme@lemmy.today · 14 pts · 30d (4 replies)

So get a gallon of milk, and IF they have eggs, get a dozen (gallons of milk). Basically this is an if statement meaning if X is true, do this. Well normally we think get a dozen would be get 12 eggs, but because "have eggs = true" that meant get 12 gallons of milk. The opposite would've been eggs=false and he'd come home with 1 gallon.

I'm not a Dev so I can't write the code better, but I understand the language enough

db2@lemmy.world · 17 pts · 30d

eggs?(milk=12):(milk=1);

return milk;

AlteE@programming.dev · 6 pts · 30d (2 replies)

Ahh, my bad. I forgot that in English dozen means 12 but dosens means 10*n with n > 1.

unitedwithme@lemmy.today · 11 pts · 30d

NP. We don't even use dosens in America so I learned something new!

eager_eagle@lemmy.world · 2 pts · 30d

people say tens for multiples of 10