How to Delete Code
summary
Practical rules for finding and removing dead C++: use git blame and grep to spot stale files, run cppcheck and CI builds to find unreachable code, and experiment in compiler explorer or unit-test harnesses before touching trunk. Prefer small, reversible edits and atomic commits so reverts are trivial. One example shows ~400 changes over 10 years vs 35 changes over 18 years; at one contract far more code gets deleted than written as messy layers are peeled away.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 5:59Dead code exists why
- 15:35Dead code accumulation causes
- 27:43Challenges in deleting code
- 42:58Identifying dead code techniques
- 55:30Safe code to delete types
- 1:01:16Cleaning code and comments
- 1:11:18Best times to delete code
- 1:14:17Integrating deletions how
- 1:17:12Conclusions and call to action
related talks
27mThe art of deleting code
38mDeleting Code Is Hard And You Should Do It
58m10 Techniques to Understand Existing Code
44mSurviving Code Reviews
42mGetting Ahead By Deleting Code
47mAdventures with C++ Legacy Codebases: Tales of Incremental Improvement
39m7 Secrets of Maintainable Codebases
25mBest Practices for Writing Clean and Maintainable Codes
