Design Patterns · Senior · Question 64 of 75
How does Chesterton's fence apply to refactoring legacy code?
- ✓Correct answer: Before removing odd-looking code, find out why it was added - it may handle a real edge case
- 2Always remove code you don't understand
- 3Never touch legacy code
Explanation
Git blame, linked tickets, ADRs and characterization tests reveal the reasons behind strange code.