Rewriting Code From Scratch vs Strangler Fig Pattern
Developers should consider rewriting code from scratch when the existing codebase has become so brittle, poorly documented, or architecturally flawed that incremental changes are no longer cost-effective or feasible, such as in legacy systems built with obsolete technologies meets developers should use this pattern when they need to modernize a large, monolithic legacy application that is difficult to maintain or scale, but cannot be replaced all at once due to business continuity requirements. Here's our take.
Rewriting Code From Scratch
Developers should consider rewriting code from scratch when the existing codebase has become so brittle, poorly documented, or architecturally flawed that incremental changes are no longer cost-effective or feasible, such as in legacy systems built with obsolete technologies
Rewriting Code From Scratch
Nice PickDevelopers should consider rewriting code from scratch when the existing codebase has become so brittle, poorly documented, or architecturally flawed that incremental changes are no longer cost-effective or feasible, such as in legacy systems built with obsolete technologies
Pros
- +This approach is particularly useful for projects where technical debt has accumulated to a point where it severely hinders development speed, security, or scalability, allowing teams to start fresh with cleaner code and better design
- +Related to: refactoring, technical-debt-management
Cons
- -Specific tradeoffs depend on your use case
Strangler Fig Pattern
Developers should use this pattern when they need to modernize a large, monolithic legacy application that is difficult to maintain or scale, but cannot be replaced all at once due to business continuity requirements
Pros
- +It is particularly useful in scenarios where the legacy system is critical to operations, allowing teams to incrementally refactor or rebuild components while keeping the overall system functional
- +Related to: microservices, refactoring
Cons
- -Specific tradeoffs depend on your use case
The Verdict
Use Rewriting Code From Scratch if: You want this approach is particularly useful for projects where technical debt has accumulated to a point where it severely hinders development speed, security, or scalability, allowing teams to start fresh with cleaner code and better design and can live with specific tradeoffs depend on your use case.
Use Strangler Fig Pattern if: You prioritize it is particularly useful in scenarios where the legacy system is critical to operations, allowing teams to incrementally refactor or rebuild components while keeping the overall system functional over what Rewriting Code From Scratch offers.
Developers should consider rewriting code from scratch when the existing codebase has become so brittle, poorly documented, or architecturally flawed that incremental changes are no longer cost-effective or feasible, such as in legacy systems built with obsolete technologies
Disagree with our pick? nice@nicepick.dev