A women sent her kid that was into programming to the grocery store and told it:

“Please buy 1 bottle of milk if they have eggs buy 2”

The kid returned with just 2 bottles of milk. When it’s mom ask why it bought 2 bottles of milk, the kid said:

“Because they had eggs”

… Was the kid right?

    • Feyter ( Feyter@programming.dev ) OP
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 years ago

      Yes the joke is definitely on human language and not on programming but I think programmer can be relate here. At least I feel this joke is made in every computer science ground class ever.

    • jorge ( jalda@sopuli.xyz ) 
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 years ago

      I heard this joke in Spanish, but the meaning is a bit different. Eggs is a colloquial/slang term for testicles (like balls in English), so “if you have eggs” means “if you dare”.

    • Snaggen ( Snaggen@beehaw.org ) 
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 years ago

      The joke lies in interpreting human languages as if it was a computer algorithm. Remove any computer language context, and it is hard to even find a joke or logic in this. Any human would not do this interpretation since we can understand context, this would only be seen as a very strange attempt at a joke. However, computers don’t understand context, so adding that component and the joke makes sense. So, even if it really is a grammar joke, it needs the programming context to work as a joke.