Dead Code
ELI5 — The Vibe Check
Dead code is code that exists in the codebase but never runs — unreachable conditions, unused functions, commented-out blocks that 'might be needed later' (narrator: they won't). It's clutter that confuses developers, slows down builds, and makes grep results useless. The scariest dead code is the kind that LOOKS alive but isn't actually called from anywhere.
Real Talk
Dead code is source code that is never executed at runtime: unreachable branches, unused functions, commented-out blocks, and code behind permanently false conditions. It increases maintenance burden, confuses developers, and can mask bugs. Tools like tree shaking (bundlers), dead code elimination (compilers), and static analysis detect and remove it. Some dead code exists intentionally for A/B tests or feature flags.
When You'll Hear This
"Half this file is dead code — nobody's called these functions in two years." / "Run a dead code analysis before the next release."
Related Terms
Code Smell
Code Smell is when code isn't technically broken but something feels off — like a 500-line function, a class named 'Manager' that does everything, or a com...
Linter
A linter is the code police — it automatically checks your code for style violations, bad patterns, and potential bugs without running it.
Refactor
Refactoring is cleaning and reorganizing your code without changing what it does — like tidying your room without throwing anything away.
Technical Debt
Technical debt is the coding equivalent of putting things on a credit card.
Tree Shaking
Tree shaking is when your bundler looks at all the code you imported but never actually used, and throws it in the trash.