One red command

Think of it when something is broken, or you are about to change code you cannot check by eye.

In everyday life

Like tuning a guitar with an electronic tuner instead of by ear at the next concert. The tuner answers after every turn of the peg, so you learn what each turn did.

One case

A bank app shows the wrong balance for some accounts. A developer guesses a cause, edits, deploys to the test server and clicks through the app: 20 minutes per guess. After 6 guesses and 2 hours, the balance is still wrong, and nobody knows what each edit did. A script that loads one bad account and prints its balance would take 3 seconds per run.

One red command
The ideaWhile you build
One red command

One command you can run again and again that says pass or fail about the exact thing you care about. The faster and more reliable it is, the faster you learn.

While you build, Habits

Every case

You learn only as fast as you can check. A 20-minute check allows a few guesses a day, so people guess big and change many things at once. A 3-second check allows hundreds of small tries, and each one shows what one edit did. A good loop is fast, gives the same answer every run, and goes red on this exact problem. A flakyPasses or fails by luck, for example because of timing or the network, even when nothing changed. loop teaches you little, because a red result may be luck.

The word

Engineers call this

feedback loopOne command you can run again and again that says pass or fail about the exact thing you care about. The faster and more reliable it is, the faster you learn.

Build the loop before you guess: one command that goes red on this problem. Then make it faster and more reliable.

Where this idea leads

Skills that encode it

  • diagnosing-bugs Matt PocockPhase 1 is the skill: one fast, deterministic command that goes red on this exact bug, built before any guess.
  • tdd Matt PocockThe red-to-green loop: write a failing test first, then only enough code to make it pass.