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

  • dnick@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    2 days ago

    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.