▲ 139 ▼ A software developer's wife asked him to get a gallon of milk from the store (lemmy.zip) submitted 3 months ago by RacerX@lemmy.zip to c/programmer_humor@programming.dev 26 comments fedilink hide all child comments "... 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!"
[–] Oisteink@lemmy.world 25 points 3 months ago (6 children) No - he was asked to bring 1 or 12, not 1 and 12 permalink fedilink source parent hideshow 6 child comments replies: [–] CallMeAl@piefed.zip 32 points 3 months ago (4 children) try reading it again. Wife clearly says "and" not "or" permalink fedilink source parent hideshow 4 child comments replies: [–] vinnymac@lemmy.world 21 points 3 months ago (3 children) 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 permalink fedilink source parent hideshow 3 child comments replies: [–] CallMeAl@piefed.zip 8 points 3 months ago (2 children) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] vinnymac@lemmy.world 10 points 3 months ago* 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 * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛 permalink fedilink source parent load more comments (1 reply) [–] 4am@lemmy.zip 1 point 3 months ago Found the BSAs permalink fedilink source parent
[–] CallMeAl@piefed.zip 32 points 3 months ago (4 children) try reading it again. Wife clearly says "and" not "or" permalink fedilink source parent hideshow 4 child comments replies: [–] vinnymac@lemmy.world 21 points 3 months ago (3 children) 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 permalink fedilink source parent hideshow 3 child comments replies: [–] CallMeAl@piefed.zip 8 points 3 months ago (2 children) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] vinnymac@lemmy.world 10 points 3 months ago* 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 * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛 permalink fedilink source parent load more comments (1 reply)
[–] vinnymac@lemmy.world 21 points 3 months ago (3 children) 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 permalink fedilink source parent hideshow 3 child comments replies: [–] CallMeAl@piefed.zip 8 points 3 months ago (2 children) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] vinnymac@lemmy.world 10 points 3 months ago* 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 * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛 permalink fedilink source parent load more comments (1 reply)
[–] CallMeAl@piefed.zip 8 points 3 months ago (2 children) 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. permalink fedilink source parent hideshow 2 child comments replies: [–] vinnymac@lemmy.world 10 points 3 months ago* 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 * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛 permalink fedilink source parent load more comments (1 reply)
[–] vinnymac@lemmy.world 10 points 3 months ago* 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 * "🥛"); // 🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛🥛 permalink fedilink source parent