Ages 9–14 · Grades 5–8 · Computer Science

TraceForge

Four lines, an empty box called score, a blank output tape. Tap to run line 1.

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:

  1. 1613 “Computer” is printed as the name of a person who calculates.
  2. 1843 Note G sets out a calculation step by step, a table of its variables after each operation.
  3. 1878 Edison writes of “bugs”, meaning small faults in a machine.
  4. 1947 A moth is found in the Harvard Mark II and taped into its logbook: “First actual case of bug being found.”
  5. 1962 Katherine Johnson checks the numbers for John Glenn’s orbit by hand, at his request.

Sources: Oxford English Dictionary, “computer, n.” (earliest use: Richard Brathwait, The Yong Mans Gleanings, 1613) · L. F. Menabrea, “Sketch of the Analytical Engine”, translated with notes by A. A. L. [Ada Lovelace], Scientific Memoirs vol. 3 (1843), Note G · Smithsonian National Museum of American History, log book with computer bug (Harvard Mark II, 9 September 1947) · Thomas A. Edison Papers, Rutgers University: letter to Theodore Puskas, 13 November 1878 · Margot Lee Shetterly, Hidden Figures (William Morrow, 2016)

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

Chosen from what this app is about. What you open is remembered on this device only.