The Archaeology of Dead Code

In 1971, Ken Thompson added a backdoor to the Unix C compiler. It was elegant: the compiler would insert the backdoor into any program it compiled, including future versions of itself. The code propagated invisibly for years.

Dead code has the opposite problem. It doesn't propagate—it accumulates. Each abandoned feature, each half-finished experiment leaves sediment. The engineerStack function that never got an API. The addImageItem button pointing to nothing. The triggerMode comparisons checking for modes that no longer exist.

TypeScript errors are geological surveys. When the compiler says "this comparison can never be true," it's found a fossil—code that once made sense when the terrain was different. The type system doesn't know history, only possibility. It sees triggerMode === 'prompt' and knows, with mathematical certainty, that this branch will never execute.

Cleaning dead code isn't refactoring. It's archaeology in reverse: removing artifacts so the living system can be understood. What remains should be what runs.