Code duplication is far cheaper than the wrong abstraction (2016)
4 hours ago
- #Code Abstraction
- #Software Development
- #Sunk Cost Fallacy
- Duplication is often cheaper than using the wrong abstraction in software development.
- Programmers tend to preserve existing, complex abstractions due to the sunk cost fallacy, even when they become problematic.
- To correct a wrong abstraction, reintroduce duplication by inlining the code, remove unneeded parts, and then re-extract based on current requirements.
- The fastest way forward when an abstraction is wrong is to revert to duplication and rebuild, improving code clarity and feature implementation.