Skip to content
Programming contents

Lesson 1.1: What a program is

A program is a list of instructions. The computer follows them one by one, in order, and guesses nothing.

The idea

The computer does exactly what the list says:

  • In order: top to bottom, one instruction after another.
  • To the letter: it doesn't understand what you meant, only what you wrote.
  • Without getting tired: it repeats the same thing a million times without a mistake.

A program without a computer

A recipe is a program for a person:

Pseudocode
Heat water
Pour the water into the cup
Put in the tea bag
Wait 3 minutes
Take out the tea bag

If you change the order and take the bag out before putting it in, you can still follow the recipe, but the tea comes out wrong. A program works the same way: the computer doesn't warn you, it does what it says.

The computer doesn't guess

A person understands "add a little sugar". A computer needs to know how much: "add 1 spoonful".

Programming is, above all, saying things so they can't be misread.

Try it

Exercise

Write the instructions for brushing your teeth, one per line. Then read them as a robot that only does what it says. Is a step missing?

Show the solution

One possible answer:

Pseudocode
Pick up the toothbrush
Open the toothpaste
Put toothpaste on the brush
Close the toothpaste
Brush your teeth for 2 minutes
Rinse your mouth
Rinse the brush
Put the brush back

The step people forget most is opening the toothpaste. A person does it without thinking; a robot would get stuck.

Summary

  • A program is a list of instructions.
  • It runs in order, top to bottom.
  • The computer doesn't guess: you have to say everything, clearly.