Core of Logic
Menu

2025-11-12

Teaching Invariants Before Pointers

By Salome Janelidze

pedagogy · data structures · Poti

Teaching Invariants Before Pointers

When participants open an editor first, they often patch symptoms. In our Data Structures Reloaded track, we delay allocation questions until everyone can recite the shape lemma for the structure on the board.

The ritual is simple: write three invariants, read them aloud, then sketch pointer motion. Only after that do we allow keyboard time. Awkward? Frequently. Effective for debugging stale references? Consistently.

We borrowed the ritual from Poti evening studios where space is tight—paper travels better than laptops between desks. Participants photograph the board, not the code, which keeps attention on contracts.

If you are self-paced, record a 90-second audio memo after each invariant pass. It is slower than jumping to tests, yet it cuts the “mysterious segfault” tickets we see in later weeks.