Hammurabi
Every law in the Code of Hammurabi is a conditional — šumma awīlum, “if a man…”. So is every law here: if the mechanism holds, then do this, unless the counter-force applies.
01Type 1 vs Type 2 Decisions
If
The brain instinctively treats all failures as threats to survival, demanding excessive caution for reversible decisions (Two-way doors). This causes "Analysis Paralysis."
Then
If a decision is easily reversible (two-way door), ship within 24 hours to gain data. Only spend days/weeks on "one-way doors" (e.g., core database schema, security protocols).
Unless
The "One-Way Door" Filter
Prologue
“…to bring about the rule of righteousness in the land, so that the strong should not harm the weak.”
Hammurabi did not invent justice; he wrote it down, numbered it, and set it in stone where everyone could read the same law. This codex does that for engineering — the recurring forces that govern systems, teams, and decisions, carved as articles so they can be cited, argued, and amended, rather than rediscovered at 3 AM.
The Laws
- 01Type 1 vs Type 2 DecisionsReversibility of Decisions.
- 02Normalization of DevianceThe erosion of safety standards.
- 03Chesterton's FenceSecond-Order Thinking.
- 04Normalcy BiasCrisis Denial.
- 05Law of TrivialityCognitive Ease — the bike-shed problem.
- 06Gall's LawEvolutionary Design.
- 07Conway's LawMirroring.
- 08Hyrum's LawImplicit Contract.
- 09Brooks' LawCommunication Debt.
- 10XY ProblemGoal Misalignment.
- 11Postel's LawFault Tolerance — the Robustness Principle.
- 12Hanlon's RazorAttribution Bias.
- 13Hofstadter's LawRecursive Estimation Bias.
- 14Goodhart's LawMetric Obsolescence.
- 15Lindy EffectSurvivability.
- 16Sunk Cost FallacyLoss Aversion.
- 17Cargo Cult EngineeringSurface Imitation.
- 18Amdahl's LawDiminishing Returns.
- 19Law of Leaky AbstractionsComplexity Leakage.
- 20Pareto PrincipleDistribution Inequality — the 80/20 rule.
- 21Survivorship BiasInvisible Failures.
- 22Kernighan's LawComplexity Debt.
- 23Cobra EffectPerverse Incentives.
- 24Dunbar's NumberCognitive Scaling Limit.
- 25Worse is BetterPragmatic Design Philosophy.
- 26Cunningham's LawSocial Knowledge Extraction.
- 27Bystander EffectDiffusion of Responsibility.
- 28Murphy's LawFailure as a Default Assumption.
- 29Boy Scout RuleContinuous Improvement.
- 30Tesler's LawComplexity is a Conserved Quantity.
- 31Dunning-Kruger EffectMetacognitive Blind Spots.
- 32Curse of KnowledgeExpert-Novice Asymmetry.
- 33Swiss Cheese ModelLayered Defense and Aligned Holes.
- 34Premature OptimizationMisallocated Engineering Cost.
- 35Linus's LawDistributed Bug Detection.
- 36CAP TheoremImpossibility Under Partition.
- 37Little's LawQueueing Invariant.
- 38Two Generals ProblemImpossibility of Guaranteed Agreement.
- 39Peter PrinciplePromotion to Incompetence.
- 40Parkinson's LawWork Expands to Fill Time.
- 41Wirth's LawSoftware Bloat Outpaces Hardware.
- 42Ninety-Ninety RuleThe Estimation Tail.
- 43Eagleson's LawCode Memory Decay.
- 44Hick's LawChoice Overload.
- 45Fitts's LawTarget Acquisition Cost.
- 46Miller's LawWorking-Memory Limit.
- 47Fallacies of Distributed ComputingThe hidden assumptions of networked code.
- 48Ironies of AutomationAutomation reshapes the human role rather than removing it.
- 49Principle of Least PrivilegeGrant the minimum authority required.
- 50Kerckhoffs's PrincipleSecurity must not depend on the secrecy of the mechanism.
- 51Gustafson's LawScaled speedup for growing problems.
- 52The Tail at ScaleTail latency dominates at fan-out.
- 53Ashby's Law of Requisite VarietyOnly variety can absorb variety.
- 54Law of DemeterPrinciple of Least Knowledge.
- 55Jevons ParadoxEfficiency can increase total consumption.
- 56Normal Accident TheoryIn some systems, accidents are structural.
- 57Broken Windows TheoryVisible disorder invites more disorder.
- 58YAGNIYou aren't gonna need it — build for the case in front of you.
- 59KISS PrincipleSimple enough to be repaired under bad conditions.
- 60DRY PrincipleEvery piece of knowledge has one authoritative representation.
- 61Theory of ConstraintsThroughput is set by exactly one constraint at a time.
- 62Occam's RazorPrefer the explanation that requires the fewest new assumptions.
- 63Single Responsibility PrincipleA module should have one reason to change. The S in SOLID.
- 64Principle of Least AstonishmentA component should behave the way its users already expect.
- 65Second-System EffectThe second system a person designs is the most dangerous one.
- 66Moore's LawTransistors per chip double on a regular cadence.
- 67Amara's LawOverestimated in the short run, underestimated in the long run.
- 68The Bitter LessonGeneral methods that scale with computation beat handcrafted knowledge.
- 69Metcalfe's LawA network's value grows faster than its size.
- 70Ringelmann EffectEffort per person falls as the group grows.
- 71Shirky PrincipleInstitutions will try to preserve the problem to which they are the solution.
Epilogue
Good engineering is not the avoidance of all risk, but the deliberate choice of which risks are worth taking.
Let the engineer who tears down a fence without learning why it stands, who turns a measure into a target, or who calls a hard problem easy — inherit the pager at 3 AM.