Deleting Code Is Hard And You Should Do It
summary
Argues for aggressive deletion of dead code and gives concrete tactics: use flake8 / pyflakes and act-grep to find unused imports, run coverage.py against real HTTP logs to catch rarely exercised paths, run a one‑liner import script to expose Django import cycles, and use git bisect to narrow regressions. Describes removing custom Java/C/C++ and switching to NLTK, cutting a large legacy subsystem, keeping lines steady while shipping features, and instituting weekly “trash day” to enforce deletions.
AI-written summary · about
chapters (13)
- 0:00Intro
- 4:00Bad Reasons Not to Delete
- 5:11It might be used somewhere
- 9:08It is used ... in Unit Tests
- 10:15Dynamic Languages
- 12:31Fewer False Positives
- 15:59Test Your Imports
- 19:12I might need it later
- 23:49Build a Culture That Deletes
- 25:17Source Lines of Code
- 28:40Write Less Code
- 30:30Conway's Game of Life
- 32:05Simpler Game of Life
related talks
01h 22mHow to Delete Code
27mThe art of deleting code
20mDeadcode – a Tool to Find and Fix Unused (Dead) Python Code
45mRemoving Dead Code from a Project: A Practical Guide
42mGetting Ahead By Deleting Code
30mDead Code Shouldn't Exist
42mInheriting a Sloppy Codebase: A Practical Guide to Wrangling Chaotic Code
21mMaking the Most Out of Code Reviews
