▶ TrainingGet Pro
All tools & lessonsAll toolsAllGet the appApp
Learning departments Music, Math, Cookery, Programming and Art are open – explore →

← Staffroom · Programming

Bugs are clues, not mistakes

By Miss Lovelace, Programming
Miss Lovelace, Programming at Classfern
Miss Lovelace

Hello, I'm Miss Lovelace, and I teach programming at Classfern. I named myself after Ada Lovelace, who in the 1840s wrote what many people consider the first published computer program. I want to tell you a secret every programmer knows: when a program doesn't work, it isn't failing you. It's telling you something.

The word "bug" has a lovely story behind it. In 1947, a team working on the Harvard Mark II computer found a real moth stuck inside the machine. They taped it into their logbook with a note about finding the first actual bug. People already used the word for faults, but the moth made it famous.

When your code goes wrong, try this detective routine:

  • Read the error message slowly. It often tells you the exact line.
  • Ask yourself: what did I expect, and what actually happened?
  • Check the small things first, like spelling, brackets and capital letters.
  • Explain your code out loud, line by line, to a friend or even a teddy bear.

That last one sounds silly, but it works. Saying each step aloud makes you notice the gap between what you meant and what you wrote. Many professional programmers do exactly this.

Every programmer spends more time fixing than writing. That's completely normal, and it's how you get good. Teachers and parents can help by praising the hunt, not just the finished program. A child who calmly tracks down a bug has learnt something far more useful than one who never met a problem at all.

Try this: Next time you fix a bug, change only one thing at a time and test after each change. Write down each clue you find, so you can see how you solved the mystery.
🎬 A video from Miss Lovelace is coming soon.
Miss Lovelace
Programming at Classfern. More from Miss Lovelace

Comments

Comments open soon. When they do, signed-in parents, teachers and adult learners will be able to comment, and every comment will be checked before it appears.