← All Notes
AUG 2024 / ENGINEERING

Writing Code You Can Delete.

EngineeringMaintainability

The highest praise I can give a piece of code isn’t that it’s elegant. It’s that someone could delete it in an afternoon without fear, because its boundaries are honest about what it depends on and what depends on it.

A function highlighted for deletion in a diff view

Most codebases don’t rot because the code is badly written. They rot because nothing in them is safe to remove — every function has an unknown number of silent callers, so everyone keeps adding and nobody ever subtracts.

Optimizing for deletability, not cleverness, is the closest thing I’ve found to a durable engineering principle.

← Back to All Notes