The "Trash Can Method" for software development
Summary
The "Trash Can Method" in software engineering advocates for a development approach where discarding code is an acceptable and even encouraged practice. This method operates under two primary models. The first involves using Pull Requests (PRs) or preview branches to validate a proposed feature; if the feature is deemed undesirable after initial implementation, the PR is simply closed, and the code is discarded. The second model applies to more significant product iterations: after shipping a Version 1 (V1) and gathering customer feedback over a period, such as 10 weeks, developers might gain a clearer understanding of the optimal product shape and architecture. In such cases, it becomes economically viable to "trash all the code" from V1 and rebuild Version 2 (V2) from scratch on a new branch, rather than attempting to refactor or build upon the initial codebase, due to the perceived low cost of code.
Key takeaway
For software engineering teams evaluating architectural decisions or feature development, embrace the "Trash Can Method" to reduce long-term costs. If you are unsure about a feature's value, use PRs or preview branches to build and discard code quickly. For significant V2 iterations, consider rebuilding from scratch after V1 customer feedback, rather than costly refactoring, as the initial code's cost is often low. This approach prioritizes agility and validated learning over preserving early code.
Key insights
The "Trash Can Method" embraces discarding code as a valid, cost-effective software development strategy.
Principles
- Code has a low cost, making rebuilds viable.
- Validate early with disposable code.
- Customer feedback informs architectural resets.
Method
The method involves either closing a PR for an unvalidated feature or rebuilding a V2 from scratch after V1 customer feedback, discarding all prior code.
In practice
- Use preview branches to test feature desirability.
- Consider full rebuilds for V2 after V1 feedback.
- Close PRs for unneeded features.
Topics
- Software Engineering
- Agile Development
- Code Management
- Product Iteration
- Architectural Design
- Pull Requests
Best for: Machine Learning Engineer, Entrepreneur, Software Engineer, Product Manager
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by How I AI.