๐ WAYPOINT LESSON
State-table discipline
โญโญโญ advancedโณ 10 min read๐ Lesson 165 of 256
One row per event, one column per changing value โ and the two misdirections (dead variables, frozen values) that break traces.
Tracing is a skill with technique. The exam's hardest tracing items share three properties: many small state changes, at least one misdirection (a variable that looks important but is dead), and a boundary case in the middle of the loop, not at the start.
The state-table discipline:
- One row per event (a call, an iteration, an assignment to a reference) โ not per line.
- One column per piece of state that can change. Include the object
graph when references move:
a โ obj1is a row of its own. - Never recompute a column from memory; read the row above and apply exactly the code you see.
- The answer is a cell in the table. If it is not, you traced the wrong thing.
Watch for the two classic misdirections: a variable updated but never read (dead), and a variable read but never updated after the first iteration (frozen).