What are the DRY and DIE principles?
What are the DRY and DIE principles?
The DRY principle, standing for "Don't Repeat Yourself," is a fundamental concept in software development aimed at reducing repetition of software patterns, replacing them with abstractions, or using data normalization to avoid redundancy. This principle emphasizes that every piece of knowledge in a system should have a single, unambiguous, authoritative representation. It was introduced by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. The DRY principle is applied broadly, including to database schemas, test plans, the build system, and even documentation. Its successful application means that a modification in any single element of a system does not necessitate a change in other logically unrelated elements. Moreover, elements that are logically related change predictably and uniformly, thus are kept in sync. The principle advocates for the use of methods, subroutines, code generators, automatic build systems, and scripting languages to observe DRY across different layers of development[8].
The DIE principle, which stands for "Duplication Is Evil," is closely related to the DRY principle and emphasizes the negative impact of duplicating code or logic within a system. While the DIE principle is not as widely recognized or documented as DRY, it shares the sa...
middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào