Kelly Mears

Fail Fast

Crash at the point of misconfiguration rather than degrading quietly into a wrong state.

Method2 min read219 words14 out · 26 in
also calledFail loud

Fail fast is the principle that a program should stop at the first moment it knows something is wrong, as close as possible to the cause, rather than continuing in a degraded state. The crash you get from a missing configuration value is not a defect — it is the signal you wanted.

The idea is easiest to see in its negation. A required setting read as PORT ?? "3000" will boot on a broken environment, bind the wrong port, and surface hours later as an authentication error nobody connects to the config. Reading it through a helper that throws on absence turns a mysterious downstream failure into a one-line startup error. See Defensive Default and Environment Variable.

Fail fast is not a blanket ban on fallbacks. Coalescing an absent list to an empty list is a narrowing convenience with no hidden state. The distinction is whether the default can stand in for a real value and be wrong: identity, credentials, hosts, ports, and secrets should never have one.

There is a reporting corollary. When a step cannot do its job, it should say so rather than emit a plausible-looking result. A build that produces five empty pages should report failure, not "built five pages" — honest reporting is what makes the metric usable at all. See Goodhart's Law.

See also11

Monad

A wrapper type with a way to lift a value in and a way to chain functions that return more wrappers.

Computation & Algorithms11 connections

Silent Failure

A failure that produces no signal, so the absence of an error reads as success.

Method73 connections

Secret Management

Storing, distributing, and rotating credentials without embedding them in code or history.

Systems & Tooling33 connections

Observability

How much of a system's internal state can be inferred from what it emits.

Method32 connections

Assertion

The statement in a test that must hold, and the only part that can actually fail.

Testing & Verification19 connections

Human in the Loop

Requiring a person's judgment at chosen points in an otherwise automated process.

Agents & Language Models12 connections

Unreachable Code

Code no input can execute — usually a guard against a state the surrounding invariants forbid.

Testing & Verification11 connections

Cron

Time-based scheduling of recurring jobs, and the reasons scheduled jobs quietly stop working.

Systems & Tooling19 connections

Kernel Panic

The operating system kernel deliberately halting when it detects an error it can't safely recover from, the Unix version of the Blue Screen of Death, and how crash dumps and watchdogs turn it into a fast reboot.

Systems & Tooling10 connections

Fail-Safe

A design principle in which a system that breaks falls into a safe state rather than a dangerous one, as when a railway signal drops to stop or a train's brakes apply if their air line is cut.

Testing & Verification6 connections

Exit Status

The small number every process returns when it ends, zero for success and anything else for failure, and the conventions that let shells, CI systems, and init systems act on it.

Systems & Tooling10 connections

Linked from26