๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Programming Concepts Beginner

What is DRY (Don't Repeat Yourself)?

A software development principle that aims to reduce code duplication by abstracting common patterns into reusable components.

DRY states that every piece of knowledge should have a single, unambiguous representation in a system. Duplicate code means duplicate bugs and duplicate maintenance effort. Extract common logic into functions, classes, or modules.

However, premature abstraction can be worse than duplication. The "Rule of Three" suggests abstracting only after seeing the same pattern three times. WET (Write Everything Twice) and AHA (Avoid Hasty Abstractions) are counterbalancing principles that warn against over-abstraction.

Related Terms

Twelve-Factor App
A methodology of twelve best practices for building modern, scalable, maintainable software-as-a-service applications.
Race Condition
A bug that occurs when the behavior of software depends on the timing or order of uncontrolled events like thread scheduling.
Refactoring
Restructuring existing code without changing its external behavior to improve readability, maintainability, and performance.
Thread
The smallest unit of execution within a process, allowing concurrent operations to run within a single program.
Hash Table
A data structure that maps keys to values using a hash function, providing average O(1) time complexity for lookups, insertions, and deletions.
Agile
A software development methodology that emphasizes iterative development, collaboration, and rapid response to change.
View All Programming Concepts Terms โ†’