Grade 7 Computer Science · What a program is
Why a computer takes everything literally
People fill in what an instruction leaves out; a computer does not.
Why the computer never says “got it”
Send a friend the same request twice and they will assume you repeated yourself by accident. A computer will carry it out twice, without asking. Is that a weakness of the machine — or the very reason mistakes in it can be found at all?
Before writing a single line of code, one thing about the other side must be understood: a computer does not understand you. It executes. The difference between the two is the source of nearly every beginner’s mistake, and so we begin there.
| What was said | What a person understands | What a computer executes |
|---|---|---|
| “Bring a glass of water” | A roughly full glass, without spilling | An error — “glass” was not defined |
| “Add one” | To the number we were discussing | To which value? It must be said |
| “Repeat that” | A few more times, roughly | Exactly how many times? |
Why this is actually an advantage
It is easy to think this property is a limitation, but it is exactly what makes a computer useful. A machine that guessed what you meant would give a different result each time, and could not check itself. A machine that executes exactly what is written gives the same result on every run — and that is what lets you find a mistake: if the result is wrong, the mistake is in the text, and the text is in front of you. The absence of interpretation is what makes debugging possible at all.
print("Hello")
print("Hello")Example 1 — why “roughly” does not exist
- A person is asked to wait “a moment”.
- He waits between seconds and a minute, by context.
- A computer needs a number: exactly how many seconds.
- Anything that is not a number must be made one.
Example 2 — why the same run gives the same result
- The program does not guess and has no mood.
- The same lines, the same inputs.
- So necessarily the same result.
- If the result changed — something in the input changed.