Skip to content
Latticework
Esc
Try
All comparisons

Compare

Postel's Law or Hyrum's Law?

Postel's Law says be liberal in what you accept. Hyrum's Law says every observable behaviour of an interface will eventually be depended on. The more you quietly accept, the more behaviour others come to rely on, and the harder it is to change.

Postel's Law

Be conservative in what you send and liberal in what you accept.

Reach for it when

  • Integrating with many independent parties you do not control
  • Reading data from producers you cannot fix quickly
Read Postel's Law

Hyrum's Law

With enough users, every observable behaviour of your API will be depended on by somebody.

Reach for it when

  • Publishing an API you must keep evolving
  • Deciding what to document, validate and test as part of the contract
Read Hyrum's Law

Together

Accept what you must, but make the accepted range explicit and tested, and tighten it in new versions rather than letting it widen by accident. The IETF's RFC 9413 makes the same argument.