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".
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".
35 Comments
Shady_Shiroe@lemmy.world · 78 pts · 218d
I like this joke better:
Wife asks her husband if he is too obsessed with his work and if he even he loves her anymore. He assures her that in a list of things he loves the most, she is number 1 on that list. She was satisfied with the answer.
Australis13@fedia.io · 22 pts · 218d
He's safe if he works in MATLAB or other languages that use one-based indexing. He's a dead man if she works out most lists are zero-based.
lambipapp@lemmy.world · 13 pts · 217d
I work in Lua. I always start my tables on 'dinosaur'
ulterno@programming.dev · 3 pts · 217d
He'll make sure until death that his wife doesn't figure that out.
eager_eagle@lemmy.world · 17 pts · 218d
people really overthinking the joke in the comments huh
Feyd@programming.dev · 10 pts · 218d
People having seen the exact same joke that isn't even good for a decade or more....
eager_eagle@lemmy.world · 15 pts · 218d
jve@lemmy.world · 2 pts · 218d
I hate the fucking eagles, man.
zebidiah@lemmy.ca · 1 pts · 217d
Fuck you man. If you don't like my fuckin' music get your own fuckin' cab!
Feyd@programming.dev · -2 pts · 218d
That's cute, but you're complaining about people expressing their opinions on a platform where the entire point is to comment on posts...
eager_eagle@lemmy.world · 4 pts · 218d
I'm not complaining, I'm stating an observation. You seem the one bothered
ulterno@programming.dev · -1 pts · 217d
CrypticCoffee@lemmy.ml · 1 pts · 215d
I haven't seen this one. Enjoyed it.
There is a relevant xkcd for this, but I'll mark it as a lazy load.
NaibofTabr@infosec.pub · 7 pts · 218d
I mean... do you know what community you're in right now?
eager_eagle@lemmy.world · 3 pts · 217d
my bad, I thought this was a wendy's
Feyd@programming.dev · 13 pts · 218d
I've never liked this joke. I guess it's supposed to be that the husband does the literal action as described, but instead it's just that they interpreted ambiguity opposite than expected? It just really doesn't work very well :/
rockerface@lemmy.cafe · 62 pts · 218d
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 · 17 pts · 218d
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 === 6notx = 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 pts · 217d
Now just how did he procure the rest of the 5, is a mystery.
mech@feddit.org · 1 pts · 215d
He cloned the supermarket.
Captain_Faraday@programming.dev · 8 pts · 218d
Omg, youโre so right. I didnโt read it that way until you pointed that out.
jbrains@sh.itjust.works · 7 pts · 218d
Given the stereotypical difficulty of "product folks" and programmers agreeing on and building shared understanding of what to build, this joke seems clear and straightforward. It works because of course, the customer and the programmer failed to agree on something simple.
SleeplessCityLights@programming.dev · 1 pts · 217d
That is why we have spec docs, duh. /s
dnick@sh.itjust.works · 5 pts · 218d
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 · 7 pts · 218d
Python, though the logic would be backwards:
dnick@sh.itjust.works · 0 pts · 212d
Right, it would be started basically exactly the opposite. Certainly not a statement followed by an if block.
ignirtoq@feddit.online · 1 pts · 212d
The code block I wrote is a statement followed by an if. What I meant be "backwards" was the order of conditions, not that the statement came after the if. It's exactly what you asked for.
eager_eagle@lemmy.world · 3 pts · 218d
any language that allows ternary conditionals
dnick@sh.itjust.works · 1 pts · 212d
Those would all start with the if, followed by two conditions, not a statement and then an if. There would be a condition to evaluate, followed by then/else?
sping@lemmy.sdf.org · 4 pts · 218d
I'm pretty sure I've heard effectively the same core joke but better composed. Can't remember it though because at best it's middling funny.
CrypticCoffee@lemmy.ml · 3 pts · 215d
I... like this joke and haven't heard it before!
Is this allowed or do I have to shit on it to be cool?
slothrop@lemmy.ca · 5 pts · 215d
Welcome to lemmy!
presoak@lazysoci.al · 3 pts · 214d
I dig this particular wit
slothrop@lemmy.ca · 4 pts · 214d
Careful, there, you could be overthinking it!
CanadaPlus@lemmy.sdf.org · 3 pts · 217d
Skill issue. Used an implied "of them", which is idiomatic in the language, but forgot to update the value of "them" first. Without that, taking the first value is compliant with the standard.
/s, but only if we assume us programmers have common sense. ^/s^