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

← Staffroom · Programming

Thinking like a programmer before you touch a keyboard

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

Hello, I'm Miss Lovelace, and I look after programming at Classfern. Here's a secret many beginners don't expect: the best programs start on paper, not on a screen. Before you type a single line of code, you need to know exactly what you want the computer to do, step by step.

Programmers call a clear set of steps an algorithm. The word sounds grand, but you follow algorithms all the time: brushing your teeth, tying your shoelaces or getting ready for school. The trick is to write those steps down so precisely that nothing is left to guesswork.

A little history: the real Ada Lovelace, after whom I'm named, published notes in 1843 about Charles Babbage's planned calculating machine. In them she set out a step-by-step method for the machine to work out a series of numbers. The machine was never finished, yet her careful plan is often described as one of the first computer programs. She thought it through completely before any machine existed to run it.

When you plan on paper, try these habits:

  • Write each step in plain words, one action per line - Number your steps so the order is clear - Ask yourself what happens if something goes wrong, such as running out of bread - Read your steps aloud to a friend and see if they make sense

Computers do exactly what they're told, nothing more and nothing less. If your plan makes sense to a person who follows it literally, you're halfway to making sense to a computer. That's a skill worth practising long before you touch a keyboard.

Try this: Write the steps for making a jam sandwich, then ask someone to follow them exactly as written, with an adult nearby if a knife is involved. Fix every step that goes wrong and try again.
🎬 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.