Perfect Line
Interactive thesis

One line of code is very expensive

Perfect code is incredibly rare. Even confident engineers ship invisible mistakes — found in production, or when code is used in a way they never expected. Every line can hide a bug; no diff gets the scrutiny required to guarantee it always does what it should.

This project illustrates the cost of maintenance, deployment round trips, mistakes, feature requests, and insufficient testing. It is intentionally harsh: every mistake here is one that could have reached production. We try to catch it in review — but no review is perfect.

The monologue

Why a small function still carries real organizational cost

The TCO isn't apparent to most people. Code is easy. But writing a perfect line of code is rare. Something with higher cyclomatic complexity has a dramatically decreased chance of being bulletproof out of the gate.

Untested code. Unreviewed code. Cut corners. Unintended uses. Everything has edges to handle, language quirks, behavior the engineer didn't account for. And that's before external systems, architecture, review, refactoring, and years of bug fixing.

One line of code is very expensive. This experience does not prove how expensive to the dollar. It shows why: perfect is rare, so the lifecycle is expensive.

Here, every submit is a ship attempt. You wait on commit, CI workers, binary and container builds, rollout to an environment, and the suite — because real projects are not eight lines with an instant test runner. Each failed submission is imperfection that risked getting out.

People on the clock

Engineering at $100/hr from the moment the ticket opens. QA at $70/hr once the work reaches them. A PM once scope starts moving. Pipeline waits still burn their time.

Org overhead

Seats, tools, and shared CI/infra while the ticket is open (~$12/hr), plus a real CI charge every pipeline fire — not free “local npm test.”

Requirements change

Feature requests and refactors mean changing code that already worked. Anything you touch needs revalidation — and can introduce new errors.

Ship & promote

Each submit runs commit → CI → build → container → env rollout → suite. Clearing a stage promotes the revision to a higher environment before the next gate.

Customer impact

Production misses attribute exposure against product MRR (100k users × $5/mo = $500,000), scaled by how long the ticket has been open.

Performance counts

Late stages also check time and space. A correct answer that allocates poorly or loops badly still fails under load.

Challenges

Two problems. Write the function, then live with the lifecycle.

01

FizzBuzz

Easy-looking
~12 lines

The interview classic, with a twist!

function fizzbuzz(n, rules?)Open

02

Clamp a number

Thorny
~15 lines

Constrain a number to a range — then bounds swap, NaN, and exclusive flags show up.

function clamp(value, min, max, opts?)Open

How cost is counted

Role rates × wall time (including pipeline waits), org share of tools/CI seats, per-pipeline and promote events, stage-weighted fails, and — if production fails — customer exposure against $500,000 MRR scaled by time open. Numbers are illustrative; the point is the shape of the bill.

wall-clock + pipeline ship-attempt fails time-scaled exposure
Perfect Line — an illustration that perfect code is rare, so code is expensive. Costs are illustrative, not financial advice.