Ages 9–14 · Grades 5–8 · Computer Science
TraceForge
The best coders read code before they run it: read a short program, predict what it prints, then step through the real trace.
These programs are written in a teaching subset of the Swift language.
Trace of the Day
One program a day, the same for everyone today. No streak: miss a day and nothing is lost.
Where this idea comes from
Tracing a program by hand
Before machines did sums, “computer” was a job: a person who worked out calculations by hand. The word is printed for such a person in 1613. NASA still had people with that job in the 1960s.
One thing to hold: Note G, from Ada Lovelace’s 1843 notes on Charles Babbage’s Analytical Engine: a table that goes through a calculation one operation at a time and writes down what every variable holds after each step.
Why it matters: Keeping a table of every box is how people checked work before computers could, and how programmers still find mistakes. The table in Note G has a slip in its fourth operation, two numbers the wrong way round — the kind of mistake a trace table is for.
What we don’t know: Historians still argue how much of Note G was Lovelace’s own work and how much was Babbage’s. And the moth taped into a logbook in 1947 was not the first “bug”: Thomas Edison was already calling faults bugs in 1878.
Dates:
- 1613 “Computer” is printed as the name of a person who calculates.
- 1843 Note G sets out a calculation step by step, a table of its variables after each operation.
- 1878 Edison writes of “bugs”, meaning small faults in a machine.
- 1947 A moth is found in the Harvard Mark II and taped into its logbook: “First actual case of bug being found.”
- 1962 Katherine Johnson checks the numbers for John Glenn’s orbit by hand, at his request.
How are you feeling?
😄 Brain break
Meet the cast — the characters who teach this
-
Scamper runs a program the moment she sees it, before reading it — you teach her to trace first -
Jotter keeps a little table of every value, line by line -
Fencepost counts a loop's edges — the first turn and the last -
Signpost checks the condition at every if, then follows one path
What next? Pick a door
- More like this TinkerForge Change one line: what changes? BugTales Which line is the bug on? ScreenForge What screen will this code make?
- A bit harder CommandForge Which command builds the world you want? GateForge Which gates make the light come on? ScriptQuest What will this tiny program do?
- Something different ShadeQuest Which word fits this feeling best? ErrataQuest Which clue broke the old idea? FigureForge Which figure of speech is hiding here?