Computer programming is somewhat like getting an imbecile to play bridge
johndcook.com
johndcook.com
He then told me the story of his brother with Down syndrome who was once weaving a carpet and who happened to make two black spots right in the middle of the big white center of the carpet. When asked why he made that mistake the brother proudly proclaimed that it wasn't a mistake at all, ran to his pattern book and showed the pattern.
It was perforated on those spots.
That said, I'm not sure I would use this analogy myself. "Imbecile" evokes the image of somebody either making bad decisions or not cooperating with the teacher. The computer does neither--in essence it makes no decisions and cooperates too much. After all, the problem with the computer is not that it does something you didn't tell it to or something you told it not to but that it does exactly what you told it to do.
Do you know how some people sometimes act passive-aggressively and take everything you say completely literally? It's annoying. That's what programming is like.(Except, of course, I usually don't find programming annoying.)
Programmer returns home with 13 jugs of milk
Get a dozen, not a dozen more.
cart.addJugs(1);
if (haveEggs)
cart.addJugs(12);
Now the cart has 13 jugs.(For the latter option, especially if you use the word language somewhat loosely - e.g., a TCP stack isn't a programming language, but TCP is a somewhat higher-level abstraction, and it's best implemented using lower-level languages.)
'All invoices need a corresponding purchase order number'
except when the CEO asks for one because they need to submit an invoice in the next 10 minutes or it won't get paid for 2 months... what do you mean you're a computer and don't understand that basic request from your CEO?
Well this leaves out one critical piece that is a big draw to programming. Unlike the imbecile, the computer will do exactly what you tell it every time.