Before you can read the parent note, you need to understand the words and symbols it throws around as if you already knew them. This page builds each one from nothing. Read top to bottom — every idea uses only the ones above it.
Look at the figure below. The left column is the file before; the right is the file after. The red lines are the diff — the only thing a reviewer really looks at.
Figure 1 — Left: the file as it was. Right: the same file after editing, with the changed lines marked in red. A reviewer reads only the red lines (the diff), never the untouched code around them.
Why the topic needs this: a review examines a diff, not a whole program. If you didn't know what a diff was, "reviewing a change" would sound like re-reading the entire codebase every time — which nobody does.
Figure 2 — A bug on a three-station conveyor belt: Review (s=0), QA (s=1), Production (s=2). The red dot is the bug; catching it at the leftmost station costs one unit (c0), while letting it ride to the far right costs about 100 times as much. The whole cost argument is "catch it as far left as you can."
Why the topic needs this: the entire cost argument is "catch the bug at the leftmost stage." Without the belt picture, s=0,1,2 are just meaningless numbers.
The parent writes costfix≈c0⋅ks. Let's earn every letter.
Why an exponent and not just c0+k⋅s (a straight line)? Because the badness compounds: each stage multiplies the mess left by the previous stage, it doesn't merely add a fixed chunk. That's the difference between linear (+) and exponential (×) growth.
Figure 3 — The dashed black line is what cost would do if each stage merely added a fixed chunk (c0+ks); the red curve is what it actually does when each stage multiplies (c0ks). The vertical gap at s=2 — 100 units vs 21 — is the money a review can save you.
Look at the figure: the straight black dashed line (adding) barely climbs; the red curve (multiplying) explodes. The gap between them is the value of catching bugs early.
Step 1 — WHAT: split the n bugs into two buckets. With review, each bug is either caught now (probability p) or escapes (probability 1−p). Multiply the count n by each probability:
caught at review: np bugs, each costing c0 (stage s=0);
escaped: n(1−p) bugs, each costing c0k2 (stage s=2).
Step 2 — WHY expected value: we don't know which bugs escape, so we can't add exact costs. Instead we weight each cost by its probability and sum — that is exactly what E means. Add the reviewer's own time R, since running the review isn't free:
Step 3 — the comparison: with no review, nobody catches anything, so every bug reaches production:
Step 4 — WHAT we want: review is worth it when it costs less, Ereview<Enone. Subtract and watch (k2−1) appear:
nc0k2−(npc0+n(1−p)c0k2+R)>0
Group the k2 terms — nc0k2−n(1−p)c0k2=npc0k2 — then subtract the npc0:
npc0k2−npc0−R>0⟹npc0(k2−1)>R
The parent ranks: Correctness → Design → Security → Tests → Readability → Performance → Style. Each rung leans on an idea — here are the ones the parent never pauses to define:
Everything on the left is a foundation; the two arrows into "Code review what to look for" are the two halves of the parent: why it pays (the formula) and what to check (the ladder).