I removed a logging library from our build last quarter. The change was forty lines of deletes and one new helper function. Build time dropped twelve seconds. Bundle dropped four hundred KB. The on-call rotation forgot it existed. We had been paying rent on it for three years, and the only thing it did better than console.log was come with a JSON schema and a security advisory every six months.
The cheapest dependency is the one you delete. This is so obvious it sounds like a fortune cookie. It also describes work that almost nobody does, because the work has no story attached to it. There is no Friday demo for “I removed a thing.” There is no LinkedIn post for “I subtracted.” The marginal hire optimizes for what they can add to a codebase. The codebase optimizes for what it can remove.
Why deletions don’t happen
Three reasons, in rough order of which is the most embarrassing:
- Nobody owns it. The person who installed the dependency is gone. The person inheriting it isn’t sure if removing it is safe. The middle option — leaving it — never gets second-guessed in a code review.
- The shell game of “we might need this someday.” We don’t. We don’t. We will not. The thing that justifies keeping a library “for the future” almost always turns out to be a five-line function you write fresh when the future arrives.
- Deletion looks like nothing. The PR is small. The diff is mostly red. There is no feature attached. Reviewers approve it slower than feature work because there’s nothing visible to validate against.
What it costs you
Each dependency is a small ongoing tax: surface area for CVEs, time spent on version-pin bumps, build slowness, mental load when reading the codebase (“what does this import do?”). Most of these are too small to feel individually. They aggregate.
A team I worked with took two engineers’ time for a week to do nothing but subtract. They removed eighteen npm packages, two Postgres extensions, and an entire microservice. They didn’t ship a feature that week. They got two minutes back on every build for a year.
It is a real piece of work. It is rarely a glamorous one.