Programming: Your First Instructions
How you tell a computer, which understands nothing, exactly what to do, step by literal step.
AI tutor is turned off for this class
Use the CS106A lectures, notes, and assignments below to keep learning.
Big Idea
How Computing Works
Grade bands
K-2 · 3-5 · 6-8 · 9-12
AI literacy pillar
How AI works · Ethics
Lesson overview
How you tell a computer, which understands nothing, exactly what to do, step by literal step. This module climbs from an everyday intuition to the real mechanism, then names the Stanford course it descends from.
Teacher script · ~45 min
- 0–5
Hook
A computer is not clever. It follows instructions literally, in order, with zero common sense. If you tell it to put on your shoes before your socks, it will. Programming is the skill of giving instructions so precise that a thing with no judgment still gets it right.
- 5–15
Explore
Students do the activity in pairs: On paper, keep a box called 'total' starting at 0. Go through a list of prices and each time add the price to the box. You just ran a loop over a variable — the core of every spreadsheet and app.
- 15–30
Explain
A CONDITIONAL lets a program choose: IF the answer is right, say 'yes,' OTHERWISE say 'try again.' A FUNCTION is a named recipe of steps you can reuse by name instead of rewriting it. Real programs are mostly these four pieces — variables, loops, conditionals, functions — combined. DECOMPOSITION is the actual skill: splitting a big task into small pieces each of those can handle.
- 30–40
Connect to the summit
Show students this is the real thing professionals build: A real first programming course. How you tell a computer, which understands nothing, exactly what to do, step by literal step.
- 40–45
Check
Run the formative check below. Anyone who can explain a key term in their own words has it.
Student activity
On paper, keep a box called 'total' starting at 0. Go through a list of prices and each time add the price to the box. You just ran a loop over a variable — the core of every spreadsheet and app.
Slides
Formative check
- 1.In your own words, what is "Variable"? (Looking for: A named box that holds a value you can read or change later.)
- 2.In your own words, what is "Loop"? (Looking for: Telling the computer to repeat steps without rewriting them each time.)
- 3.In your own words, what is "Conditional"? (Looking for: A fork in the road: do one thing IF something is true, else do another.)
Carry-away concepts
- Variable
- A named box that holds a value you can read or change later.
- Loop
- Telling the computer to repeat steps without rewriting them each time.
- Conditional
- A fork in the road: do one thing IF something is true, else do another.
- Function
- A named recipe of steps you can reuse by calling its name.
- Decomposition
- Breaking a big task into small steps a computer can each handle.
From the summit · the Stanford source
The real first course: you write working programs from scratch — variables, loops, conditionals, functions — and learn to break any task into steps a machine can follow without ever guessing what you meant.
This module descends from CS106A at Stanford. Students who climb the full ladder arrive here.