2 Code duplication is not always bad: Code duplication vs. flexibility
This chapter covers
- Sharing common code between independent codebases
- Tradeoffs between code duplication, flexibility, and delivery
- When code duplication is a sensible choice giving us loose coupling
The DRY (don’t repeat yourself) principle is one of the most well-known software engineering rules. The main idea behind this is to remove duplicated code, which leads to fewer bugs and better reusability of our software. But over focusing on the DRY principle when building every possible system may be dangerous and hides a lot of complexities. It is easier to follow the DRY principle if the system we are building is monolithic, meaning that almost the whole codebase is in one ...
Get Software Mistakes and Tradeoffs now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.