I distinctly remember a particular moment in middle school, talking to an older friend about computers. He had taken a computer programming class, and I hadn’t.
I asked him “How does the computer know how to do what you tell it to do?” I was imagining some sort of intelligence inside the computer. You would somehow explain to it what you wanted done, and it would do it for you.
Then in ninth grade I took Mr. Haggerty’s intro to computer science class. The very first thing he did was have us program a “paper computer”. There was no real computer, just pencil and paper and some simple rules.
On your piece of paper you wrote numbers into little boxes, which were arranged in a row like in a board game. The rules dictated what happened next.
Each number represented a different rule. One number might mean “add two numbers.” Another might mean “skip forward two boxes if the answer is zero.”
It soon became clear that if you started by writing the right sequence of numbers into the boxes, you could make the “computer” calculate all sorts of interesting things. And that’s when I realized the secret of computers.
Which is that they are infinitely stupid. They have no brains at all. Computers will only do exactly what you tell them do, and nothing else.
Once you wrap your head around that, you start to see why programming works, and why programming is so powerful.