Skip to content
11 languagesDRY: one rule, one placeChange a business rule once and have every feature pick it up.
5 languagesHollywood Principle: stop polling, let the framework call youLet Checkout tell each part about an order, so none is missed.
4 languagesInversion of control: replace hand-wired flow with hooksWrite a rule for every job once, and let each job fill in its part.
5 languagesDependency Inversion: let the policy own the interfaceKeep your business rules untouched when you swap how messages are sent.
5 languagesInterface Segregation: split a fat interfaceGive each caller an interface with only the methods it calls.
5 languagesLiskov Substitution: fix a subtype that breaks callersMake every subclass work wherever its base type already works.
5 languagesOpen/Closed: register new rules, edit nothingAdd each new business rule as a new class, without editing working code.
5 languagesSingle Responsibility: split calculation from formattingKeep the money math in one class and the text in another.
5 languagesTell, Don’t Ask: move the decision inwardTell an object what to do, so its rules live in one place.
5 languagesLaw of Demeter: break the getter chainLet each class ask its neighbor, so inner changes stay inside.
5 languagesCoupling: wrap a third-party libraryKeep a vendor's library behind one class of yours, so a switch touches one class.
5 languagesSeparation of concerns: untangle the request handlerKeep the booking rule apart from HTTP and storage so every caller reuses it.
5 languagesImmutability: value objects instead of settersShare small objects like prices safely, so one change never leaks into another.
1 languagesProgramming to an interface: widen concrete parameter typesLet one receipt method send through any channel that can deliver it.
9 languagesComposition over inheritance: end the subclass explosionBuild each rental from parts, so a new car is one small class.
10 languagesPolymorphism: subclasses instead of a type fieldLet each kind answer for itself, so a new kind adds no switch case.
9 languagesInheritance: pull up duplicated behaviorWrite shared behavior once in a superclass, so every subclass gets each change.
11 languagesAbstraction: hide the data structureChange how a class stores its data without touching the code that uses it.
5 languagesEncapsulation: public fields to guarded stateMake one class own its data, so every change follows the same rules.
11 languagesObject-oriented programming: turn a script into objectsKeep each piece of data with the rules that use it, so features stop copying code.
5 languagesDesign by contract: guard the invariantsLet the object keep its own rules, so no caller can break them.
5 languagesFail fast: validate at the boundaryReject bad input at the boundary, before any code changes state.
6 languagesError handling: replace error codes with exceptionsLet failures reach the code that can handle them, without every caller checking.
11 languagesPure functions: push I/O to the edgesKeep your rules pure, so you can test them without a database.
11 languagesImperative to declarative: loops into pipelinesSay what you want from a list, and let the pipeline do the walking.
11 languagesYAGNI: delete speculative optionsDelete the settings nobody uses, so each new column is a two-line change.
11 languagesKISS: replace a rule engine with plain codeTurn a clever rule engine back into code you read top to bottom.
5 languagesClean code: extract until it readsTurn a long method into named steps you can read from top to bottom.
10 languagesClean code: rename for intentMake every name say what it means, so the next change lands right.