3.4 Avoid redundancy and duplication in code
Reduce code duplication through refactoring and reuse, ensure maintainability, and favor evolving existing solutions over rebuilding them.
Success Criteria
- Remove or simplify:
Refactor code to reduce duplication and redundancy by improving structure, consolidating repeated logic, and encouraging reuse. - Iteration over recreation:
Prioritize improving and extending existing user-facing solutions over rebuilding them from scratch. Only replace an existing solution when doing so provides clear benefits to user experience, performance, scalability, or maintainability. - Organize code arrangement:
Apply DRY (Don’t Repeat Yourself) principles to CSS and JavaScript where they improve maintainability. Ensure that efforts to reduce duplication do not increase complexity, introduce unnecessary dependencies, or adversely affect performance.