Lesson 1 — The exit code is not the output

Here is a thing that happened while building the tool that made this very course. The build printed a cheerful line — built the package (24,873 bytes, 7 files) — and exited zero. The archive opened. The page looked right. Three separate things in it were wrong.

None of them were the kind of wrong that throws an exception. That is the whole problem, and it is the specific problem you inherit the moment you start building faster than you read.

Four moves that turn ‘it ran’ into ‘it works’

  1. Say what success looks like, before you build

    Out loud, in one sentence, in the terms of the output rather than the code: every question has a visible prompt. If you cannot say it, you cannot check it, and you will accept whatever appears.

  2. Render the thing, examine and admire it

    Not the source. Not the summary of the source. The artefact a person would actually receive: the page, the file, the row in the database.

    Most silent failures are visible here and nowhere else.

  3. Grep for the claim, not the vibe

    You said every question has a prompt. So count them. Four of five empty is a number; ‘looks fine’ is not. Ask the specific question whose answer would embarrass you.

  4. Pin it so it cannot come back

    The bug you just found by eye is one refactor away from returning, and next time you will not be looking. A test is how you stop paying for the same lesson twice.

Your build exits zero and the output file opens. What have you learned?