LLMpediaThe first transparent, open encyclopedia generated by LLMs

DRY (programming)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Expansion Funnel Raw 101 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted101
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
DRY (programming)
NameDRY
Introduced1999
Originating authorAndy Hunt and Dave Thomas
GenreSoftware development principle

DRY (programming) is a software development principle that advocates reducing repetition of information and logic across codebases to improve maintainability, clarity, and changeability. Originating in the context of Agile and pragmatic programming, it intersects with software engineering practices promoted by figures and institutions such as Kent Beck, Martin Fowler, Robert C. Martin, Microsoft, and Sun Microsystems. The principle influenced practices at organizations like Google, Amazon (company), Facebook, IBM, and Netflix and is discussed in literature alongside works from O'Reilly Media, Addison-Wesley, and conferences including ACM SIGPLAN, OOPSLA, and ICSE.

Definition and principles

DRY prescribes that every piece of knowledge or logic should have a single, unambiguous, authoritative representation within a system. Originators Andy Hunt and Dave Thomas codified the concept in their book associated with The Pragmatic Programmer and contrasted it with duplication patterns critiqued by Fred Brooks in The Mythical Man-Month. The principle is instantiated through techniques espoused by Ward Cunningham, Grady Booch, and Erich Gamma such as refactoring, abstraction, and modularization, which are applied in ecosystems like Java (programming language), C#, Python (programming language), JavaScript, and Ruby (programming language). DRY interacts with design goals from ISO/IEC JTC 1 standards and with methodologies championed by Extreme Programming, Scrum (software development), and DevOps initiatives.

History and origin

The phrase was popularized in 1999 by Andy Hunt and Dave Thomas in a publication associated with The Pragmatic Programmer and grew through adoption by practitioners connected to Agile software development and advocates like Kent Beck and Martin Fowler. Early influences include engineering discussions from Bell Labs, work by researchers at MIT, and industrial practices from Sun Microsystems and Microsoft Research. The principle propagated via conferences such as OOPSLA, QCon, and journals from ACM and IEEE Computer Society and was debated in the context of software reuse dialogues involving Richard P. Gabriel and Brad Cox. As languages matured—examples being Smalltalk, Lisp (programming language), C++, and Perl—DRY shaped library design and package ecosystems such as CPAN, RubyGems, and Maven.

Rationale and benefits

Advocates argue that eliminating duplication reduces defect rates, eases change propagation, and concentrates domain knowledge in places where Alan Turing-style formal reasoning and test suites maintained by teams at Google or Mozilla can validate behavior. Benefits are cited in industrial case studies from Amazon (company), Netflix, and Spotify (company) where consolidation via services, libraries, and frameworks reduced maintenance burden and improved developer productivity. DRY supports practices like test-driven development promoted by Kent Beck and static analysis techniques from Coverity and SonarSource; it underpins architectural decisions in Service-oriented architecture and Microservices initiatives led by firms like ThoughtWorks.

Criticisms and limitations

Critics such as Joel Spolsky and commentators in ACM Queue warn that overzealous application can create inappropriate abstractions, tight coupling, and costly refactorings, echoing concerns from Fred Brooks about complexity. Instances at organizations including Microsoft and Yahoo! demonstrated that premature consolidation across divergent domains can hinder independent evolution and versioning, a tension addressed in work by Sam Newman on microservices. Discussion in venues like Stack Overflow and blogs by DHH highlight trade-offs where duplication is intentionally allowed to preserve locality, readability, or separate evolution paths. Governance frameworks from ISO and risk analyses in IEEE papers help teams balance DRY with practical constraints.

DRY is closely related to concepts and patterns including Single-responsibility principle, SRP, YAGNI, KISS principle, Separation of concerns, Abstraction (computer science), Refactoring, Design patterns (software engineering), Model–view–controller, Dependency injection, Continuous integration, and Continuous delivery. It complements tooling such as Git, Jenkins, Travis CI, Docker, and Kubernetes and integrates with package management systems like npm, pip, and NuGet. Scholars at Stanford University, Carnegie Mellon University, and University of California, Berkeley have analyzed DRY in software metrics research published in IEEE Transactions on Software Engineering and ACM Transactions on Software Engineering and Methodology.

Practical applications and examples

Practitioners apply DRY by extracting shared logic into libraries, modules, services, or templates used across projects in stacks such as LAMP, MEAN, MERN, and Ruby on Rails. Examples include consolidating authentication code into identity providers like OAuth, OpenID Connect, or systems built with frameworks like Spring Framework and Django (web framework), and creating shared UI component libraries used at companies like Airbnb, Uber Technologies, and Shopify to reduce duplicated markup and behavior. Refactoring techniques popularized by Martin Fowler and testing approaches from Kent Beck operationalize DRY via unit tests, integration tests, and continuous deployment pipelines used by teams at Google and Facebook.

Category:Software engineering principles