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".

all 36 comments

sorted by: hot top controversial new old
[–] 79 points 8 months ago (3 children)

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.

  • source
  • hideshow 3 child comments
  • [–] 23 points 8 months ago (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 18 points 8 months ago (10 children)

    people really overthinking the joke in the comments huh

  • source
  • hideshow 10 child comments
  • [–] 11 points 8 months ago (7 children)

    People having seen the exact same joke that isn't even good for a decade or more....

  • source
  • parent
  • hideshow 7 child comments
  • [–] 16 points 8 months ago (5 children)
  • [–] -2 points 8 months ago (2 children)

    That's cute, but you're complaining about people expressing their opinions on a platform where the entire point is to comment on posts...

  • source
  • parent
  • hideshow 2 child comments
  • [–] 13 points 8 months ago (14 children)

    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 :/

  • source
  • hideshow 14 child comments
  • [–] 66 points 8 months ago (4 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.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 18 points 8 months ago* (last edited 8 months ago) (2 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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 7 points 8 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 8 months ago (5 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.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 7 points 8 months ago (2 children)

    Python, though the logic would be backwards:

    milk_gallons = 6 if eggs > 0 else 1
    
  • source
  • parent
  • hideshow 2 child comments
  • [–] 0 points 8 months ago (1 child)

    Right, it would be started basically exactly the opposite. Certainly not a statement followed by an if block.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 11 points 8 months ago

    He was not instructed to get back home. To this day he is stuck in the store.

  • source
  • [–] 5 points 8 months ago* (last edited 8 months ago)

    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^

  • source
  • [–] 3 points 8 months ago (1 child)

    I... like this joke and haven't heard it before!

    Is this allowed or do I have to shit on it to be cool?

  • source
  • hideshow 1 child comment
  • [–] 3 points 8 months ago (1 child)