Software Design Principles
Software design principles are guidelines such as SOLID, DRY, KISS, and YAGNI that help programmers structure code so it stays easy to understand and change, instead of turning brittle and tangled as a system grows.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Software Design Principles
Here is the two-minute version of what a whole subfield of programming folklore is actually about: guidelines for which code structures stay cheap to change, and which ones quietly make every future change more expensive. The best-known pieces of that folklore go by acronyms — SOLID (five rules for object-oriented structure), DRY (don't repeat yourself), KISS (keep it simple), YAGNI (you aren't gonna need it) — because they got popular enough to earn one.
The problem underneath all of it is unglamorous but expensive. Software costs money twice — once to write, and continuously afterward to change. Two things drive that second cost: how much of the system you have to understand before touching one line, and how far your change ripples once you make it. Before anyone wrote these principles down, teams learned this the hard way, usually around year two, when the part of the codebase nobody thought was related to anything turned out to be load-bearing.
The move underneath everything else here is separation of concerns — Edsger Dijkstra's 1974 argument for studying one aspect of a problem in isolation without forgetting the rest exist. Coupling and cohesion are how you check whether that separation actually worked: how much one module depends on another's internals, and whether the things inside one module belong together. SOLID is what the same idea looks like once you're specifically writing object-oriented classes.
Here is the part that surprises people expecting a checklist: these principles fight each other, on purpose, all the time. Merge two things too eagerly under DRY and you can break Single Responsibility. Wrap everything in an interface "for later" and you have satisfied Open-Closed while violating YAGNI, a principle that exists specifically to stop you doing that. There is no setting where every principle is simultaneously maxed out, and treating this as a checklist to max out is itself the standard mistake. An interface with exactly one implementation and no second one coming is not discipline, it is a tax with no service behind it.
Even DRY, the one that sounds most like arithmetic, is not really about deleting duplicate lines. It is about not encoding the same fact in two places. Two functions that look alike today can be checking unrelated rules that drift apart tomorrow, and merging them early creates a worse problem than the duplication did — carrying the duplication is usually the cheaper mistake.
None of this is memorization, and nobody is grading you on reciting the acronyms in order. It is judgment about which principle is under the most pressure in the specific decision sitting in front of you right now, and which one you are tempted to apply for the wrong reason. The Cheatsheet has the fast lookup table for when you already know roughly what you are looking for. The Practice Reference turns each principle into something you actually do during a code review instead of something you nod at. Field Notes covers where this judgment gets genuinely hard in practice, including a real, measured performance cost hiding inside one of the SOLID principles that the standard advice never mentions.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.cs.utexas.edu/~EWD/transcriptions/EWD04xx/EWD447.html
Supports
- Dijkstra's 1974 coining of "separation of concerns" and its definition as studying one aspect of a problem in isolation
- The idea that separation of concerns underlies the other principles in this course
- Quiz question 1 (separation of concerns)
- https://en.wikipedia.org/wiki/Coupling_(computer_programming)
Supports
- Definition of coupling as interdependence between modules
- Low coupling correlating with maintainability and reuse
- Attribution to Larry Constantine and Structured Design, 1974
- https://en.wikipedia.org/wiki/Cohesion_(computer_science)
Supports
- Definition of cohesion as how well the elements inside a module belong together
- High cohesion correlating with maintainability, reuse, and reliability
- Attribution to Larry Constantine and Structured Design, 1974
- https://blog.cleancoder.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html
Supports
- Single Responsibility Principle definition ("one and only one reason to change")
- Framing of "reason to change" around distinct stakeholders
- Quiz questions 2 and 5 (SRP)
- https://blog.cleancoder.com/uncle-bob/2014/05/12/TheOpenClosedPrinciple.html
Supports
- Open-Closed Principle definition (extend without modifying existing code)
- Plugin architectures (editors, IDEs) as a practical example of OCP
- Quiz question 6 (OCP)
- https://en.wikipedia.org/wiki/SOLID
Supports
- Summary definitions of all five SOLID principles, including Liskov Substitution, Interface Segregation, and Dependency Inversion
- Attribution of SOLID's original principles to Robert C. Martin, 2000, and the acronym to Michael Feathers, circa 2004
- Open-Closed Principle's attribution to Bertrand Meyer, 1988
- Quiz questions 7, 8, and 9 (LSP, ISP, DIP)
- https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
Supports
- DRY principle definition ("single, unambiguous, authoritative representation")
- Attribution to Andy Hunt and Dave Thomas, The Pragmatic Programmer, 1999
- Quiz questions 3 and 10 (DRY)
- https://pragprog.com/titles/tpp20/the-pragmatic-programmer-20th-anniversary-edition/
Supports
- Confirmation of The Pragmatic Programmer as the book coining DRY, by David Thomas and Andrew Hunt
- Publisher and book scope (broad pragmatic software-development practices)
- https://en.wikipedia.org/wiki/KISS_principle
Supports
- KISS principle definition (prefer the simplest design)
- Origin attributed to Kelly Johnson at Lockheed's Skunk Works
- Quiz question 4 (KISS)
- https://martinfowler.com/bliki/Yagni.html
Supports
- YAGNI principle definition (don't build for a need you only anticipate)
- Origin in Extreme Programming, Kent Beck and Chet Hendrickson, the C3 project
- The four costs of building ahead of need (build, delay, carry, repair)
- YAGNI's dependence on malleable, refactorable, well-tested code
- Quiz question 11 (YAGNI)
- http://www.ccs.neu.edu/home/lieber/LoD.html
Supports
- Law of Demeter definition ("only talk to your friends")
- Origin at Northeastern University's Demeter Project, 1987, led by Ian Holland
- Quiz question 12 (Law of Demeter)
- https://en.wikipedia.org/wiki/Composition_over_inheritance
Supports
- Composition over inheritance definition and the is-a vs. has-a framing
- Attribution to the Design Patterns (Gang of Four) book, 1994
- Runtime flexibility of composition vs. compile-time binding of inheritance
- https://www.pearson.com/en-us/subject-catalog/p/design-patterns-elements-of-reusable-object-oriented-software/P200000009480/9780321700698
Supports
- Canonical authorship and publication of Design Patterns by Gamma, Helm, Johnson, and Vlissides
- Its role as the origin of the composition-over-inheritance guidance and the broader pattern catalog
- https://martinfowler.com/bliki/BeckDesignRules.html
Supports
- Kent Beck's Four Rules of Simple Design and their priority order (passes tests, reveals intention, no duplication, fewest elements)
- Awesome-links rationale for Kent Beck's Four Rules of Simple Design
- https://cupid.dev/
Supports
- CUPID as Dan North's 2022 alternative to SOLID and its five named properties
- Awesome-links rationale for CUPID
- https://www.elegantobjects.org
Supports
- Elegant Objects' prohibitions (null, getters/setters, static methods, mutable objects, implementation inheritance)
- Awesome-links rationale for Elegant Objects
- https://www.archunit.org
Supports
- ArchUnit as a Java library for testing architectural rules (layering, dependencies, cycles) as executable unit tests
- Awesome-links rationale for ArchUnit
- https://github.com/sverweij/dependency-cruiser
Supports
- dependency-cruiser as a tool for validating and visualizing JavaScript/TypeScript module dependencies against configurable rules
- Awesome-links rationale for dependency-cruiser
- https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle
Supports
- Bertrand Meyer naming the Open-Closed Principle in 1988, in Object-Oriented Software Construction
- Timeline event "Bertrand Meyer names the Open-Closed Principle"
- https://en.wikipedia.org/wiki/Extreme_programming
Supports
- Kent Beck becoming C3 project leader in March 1996 and refining the methodology that produced Extreme Programming
- Timeline event "Kent Beck begins leading the C3 project"
- https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction
Supports
- The mechanism by which a DRY-driven abstraction accumulates parameters and conditionals as new, slightly different requirements arrive
- The recommendation to inline a failing abstraction back into its callers and re-extract once real duplication is visible again
- Field Notes "mistake" card (DRY discipline builds the wrong abstraction)
- https://www.computerenhance.com/p/clean-code-horrible-performance
Supports
- Benchmark comparing virtual-dispatch polymorphism, a switch statement, and a lookup table for a shape-area calculation, with switch about 1.5x faster than polymorphism and a table roughly 10x faster
- The mechanism that a compiler can optimize a visible switch/table codepath but not one hidden behind a vtable
- Field Notes "tradeoff" card (Open-Closed via polymorphism has a real cost)
- https://codescene.com/blog/change-coupling-visualize-the-cost-of-change
Supports
- Change coupling / temporal coupling as files that repeatedly co-occur in the same commit set, mined from version-control history rather than static code structure
- Change coupling revealing logical dependencies (e.g. services communicating over a message bus) that static dependency analysis misses
- Field Notes "signal" card (Files that change together are coupled)
- CodeScene placement and description in Landscape
- https://deptrac.github.io/deptrac/
Supports
- Deptrac as a static analysis tool for PHP that lets a team define architectural layers and rules and enforce them in CI
- Deptrac placement and description in Landscape
- https://www.ndepend.com/docs/code-metrics
Supports
- NDepend's Lack of Cohesion of Methods (LCOM) metric and its explicit framing around the Single Responsibility Principle
- NDepend's afferent/efferent coupling metrics and CQLinq custom rules that can fail a build via quality gates
- NDepend placement and description in Landscape
- https://www.hello2morrow.com/products/sonargraph
Supports
- Sonargraph's architecture DSL for specifying an enforceable dependency model and its cyclic-dependency detection
- Sonargraph-Explorer as a free entry-level tier
- Sonargraph placement and description in Landscape
- https://tusharma.in/smells/DESIGNITE.html
Supports
- Designite's list of detected design smells, including God Class, Feature Envy, Insufficient Modularization, and Cyclic-Dependent Modularization
- Designite placement and description in Landscape
- https://tusharma.in/smells/DESIGNITEJAVA.html
Supports
- DesigniteJava's community edition being free and open-source
- Designite placement and description in Landscape
- https://pmd.github.io/
Supports
- PMD as a multilanguage static code analyzer with 400+ built-in rules covering design issues such as god classes and excessive parameter lists
- PMD bundling CPD (copy-paste detector), which finds duplicated code across 40+ languages
- PMD placement and description in Landscape
- https://github.com/kucherenko/jscpd
Supports
- jscpd as a copy/paste detector supporting over a hundred languages
- jscpd placement and description in Landscape
- https://docs.sonarsource.com/sonarqube-server/user-guide/code-metrics/metrics-definition
Supports
- SonarQube's Cognitive Complexity metric definition
- SonarQube's Duplicated Lines Density metric definition
- SonarQube placement and description in Landscape
- https://www.sonarsource.com/open-source-editions/
Supports
- SonarQube Community Build as a free, open-source edition suitable for developers and small teams
- SonarQube placement and description in Landscape
- https://codescene.com/pricing
Supports
- CodeScene being free to run against public/open-source repositories, with paid plans for private repositories
- CodeScene placement and description in Landscape
- https://qlty.sh
Supports
- Qlty Software as the product Code Climate Quality was spun out into in late 2024
- Qlty's duplication and complexity checks posting pass/fail status on pull requests, and its CLI being free with unlimited private contributors
- Qlty placement and description in Landscape
- https://deepsource.com/
Supports
- DeepSource posting static-analysis findings, including anti-patterns, as inline comments directly on pull requests
- DeepSource placement and description in Landscape
- https://deepsource.com/pricing
Supports
- DeepSource's free plan tier for small teams and public repositories, with paid plans beyond that
- DeepSource placement and description in Landscape
