Postel's Law
Be conservative in what you produce, liberal in what you accept — a design rule for interoperating systems.
Postel's Law, also called the robustness principle, instructs a system's implementation to be conservative in what it sends and liberal in what it accepts from others. Jon Postel wrote it into the original TCP specification, and it quietly shaped how the early internet's protocols tolerated the inevitable bugs in each other's implementations — a client that tolerates a slightly malformed header from a buggy server keeps the network working even when not every implementation is perfect.
The mechanism is asymmetric on purpose: you have full control over what you emit, so hold that side to the strict letter of the spec; you have no control over what arrives, so accept anything that's a reasonable interpretation of the spec even if it isn't a perfect one, rather than rejecting on a technicality. HTML parsing is the law's most famous embodiment — browsers accept catastrophically malformed markup (unclosed tags, wrong nesting) and quietly guess intent, which is precisely why the web tolerated a generation of hand-written HTML from people who'd never read a spec, and why it's still enormously hard to write a fully conformant HTML parser today.
The law has also aged into a genuine controversy, and it's worth knowing the counter-argument rather than treating it as unopposed wisdom. Being liberal in what you accept means tolerating inputs the spec never sanctioned, and those inputs become a de facto second spec the moment enough senders rely on the tolerance — see Hyrum's Law: with enough users of an interface, every observable behavior, including the lenient parsing quirks, becomes something someone depends on. Security-sensitive protocols have moved the other direction entirely, toward strict parsing and rejecting anything ambiguous, because a lenient parser is also an attacker's most reliable tool for smuggling something malformed past a filter that expected well-formed input.
The modern synthesis is roughly: be liberal when the cost of an accepted edge case is confusion, and strict when the cost is a vulnerability — the law was never meant to be applied uniformly, only where robustness against honest bugs outweighs robustness against adversarial ones.
See also8
Worse Is Better
A simpler, less correct design that ships and spreads beats a more correct one that doesn't, because adoption compounds.
Method7 connections
Defensive Default
A substituted value that papers over a missing input and hides the misconfiguration that produced it.
Method16 connections
Fail Fast
Crash at the point of misconfiguration rather than degrading quietly into a wrong state.
Method27 connections
Design System
A shared vocabulary of tokens, primitives, and rules that makes independent work converge.
Design & Interface22 connections
XML
The 1998 tag-based format for structured documents and data that once carried almost everything on the web and still underlies office files, feeds, and SVG, along with a set of well-known parser attacks.
Data & Content9 connections
Form Validation
Checking what people type into a web form before accepting it, done in the browser for fast feedback and on the server for safety, and harder than it looks because real names, addresses, and numbers break simple rules.
Web Platform11 connections
Error Message
Writing and placing the messages that tell people something went wrong, so they understand what happened and how to recover without feeling blamed.
Design & Interface13 connections
MIME Type
The short type/subtype label, born in email, that tells a browser how to treat a response, and why browsers that guess when it's missing turned a convenience into a security hole.
Web Platform12 connections
Linked from11
- Backward CompatibilityVersion Control & Delivery
Keeping new versions working with old code, data, and clients, the extreme lengths platforms go to preserve it, and the accumulated cost of never being allowed to change.
- Defensive ProgrammingTesting & Verification
Writing code that anticipates misuse and bad input, checking assumptions and handling the unexpected rather than trusting callers, along with the debate over when defense should give way to failing loudly.
- Design by ContractTesting & Verification
Specifying what each function requires and guarantees, as checkable preconditions, postconditions, and invariants, so a violation says exactly whose bug it is.
- Error MessageDesign & Interface
Writing and placing the messages that tell people something went wrong, so they understand what happened and how to recover without feeling blamed.
- Form ValidationWeb Platform
Checking what people type into a web form before accepting it, done in the browser for fast feedback and on the server for safety, and harder than it looks because real names, addresses, and numbers break simple rules.
- HTMLWeb Platform
The markup language every web page is written in, invented at CERN around 1990 as a simple way to tag documents and link them, and grown by thirty years of browser competition into an application platform.
- Hyrum's LawVersion Control & Delivery
With enough users, every observable behavior of an interface becomes a dependency for somebody.
- MIME TypeWeb Platform
The short type/subtype label, born in email, that tells a browser how to treat a response, and why browsers that guess when it's missing turned a convenience into a security hole.
- Schema EvolutionData & Content
Changing the shape of stored or transmitted data without breaking the old readers and writers that still expect the previous shape.
- Worse Is BetterMethod
A simpler, less correct design that ships and spreads beats a more correct one that doesn't, because adoption compounds.
- XMLData & Content
The 1998 tag-based format for structured documents and data that once carried almost everything on the web and still underlies office files, feeds, and SVG, along with a set of well-known parser attacks.