The Red Pencil Workshop
The workshop opens on a staged failure, because a visible row count teaches faster than a definition. On the projector, a fake ledger shows three captures for one invoice after a short reply suggested a three-try loop around a gateway timeout. The teaching assistant does not start a lecture. She slides a red pencil across the bench and holds the next patch until the pencil mark and the test log…
The "Red Pencil Workshop" introduces a unique teaching method that starts with a staged failure to demonstrate concepts more effectively than through definitions alone. This workshop is designed for individuals who have experience in writing small Python services and peer-reviewing patches before they are merged into the main codebase.
The method employs a red pencil as a script exit line, which is read aloud before any discussion about merging occurs. If the pencil mark and the test log do not agree, the paragraph is deemed unsuccessful.
The workshop is 80 minutes long, with each section serving a specific purpose. The first ten minutes review a previous failure scenario, displaying the number of attempts on the screen to emphasize the importance of a row count. The next fifteen minutes focus on setting up the local environment, including creating a virtual environment and running a command that simulates three attempts for a problematic policy.
Following this, the first exercise takes up twenty minutes, where pairs of students write a charge function that records an invoice key before a call and prevents a second call within the same process, even if the initial call raised a timeout.
The following fifteen minutes are dedicated to a countercheck, where a neighbor may provide a model reply to be pasted into a text file. However, only the neighbor running the stamp performs this action, and the stamp does not indicate confidence. The final twenty minutes involve a clean-directory rerun, including a scenario where someone may manually type a passing line. The neighbor then deletes this file, runs the test, and ensures the pencil follows the gauge.
The workshop materials are designed to be copied and executed, focusing on a specific lab design rather than a transcript of a timed class or a measured production incident. The `ledger.py` module appends an attempt before timing out, creating a trap for students who may retry the loop. To address this, students replace the loop with `charge_once`.
The `seen` set is kept only in memory, highlighting a weakness in the design. For the duration of this workshop, the focus is on stopping at one process, promoting a deeper understanding of the material.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.