npm install: Because Why Write Code When You Can Download Problems?
The JavaScript ecosystem convinced an entire generation of developers that importing someone else's 11-line function is better than writing their own. Here's why that's insane.
The JavaScript ecosystem has successfully convinced an entire generation of developers that writing code is somehow beneath them. Why spend five minutes implementing a function when you can npm install someone elseās solution and inherit their bugs, their dependencies, and their questionable life choices?
Weāve created a culture where ādonāt reinvent the wheelā has become ādonāt write any code at all.ā Your simple React app now depends on more packages than a Linux distribution. Your āHello Worldā project downloads half a gigabyte of node_modules before it prints a single character. And we pretend this is normal.
The most damning evidence of our collective insanity? left-pad. Eleven lines of code that padded strings with spaces. Eleven lines that thousands of developers decided were too complex to write themselves. When it disappeared from npm in 2016, it broke Babel, React, and half the JavaScript ecosystem. We built our entire industry on top of someone elseās homework assignment.
But hereās the uncomfortable truth nobody wants to admit: Your āHello Worldā app somehow needs 50,000 dependencies because weāve forgotten how to program.
Weāve confused software engineering with package curation. Weāve replaced problem-solving with problem-importing. Modern JavaScript developers spend more time reading package.json files than writing actual business logic. Weāve become digital hoarders, collecting dependencies like Pokemon cards, convinced that more packages somehow equals better architecture.
The security implications are terrifying. Every dependency is a potential attack vector. Every npm install is an act of blind trust in strangers on the internet. Remember event-stream? A package with 2 million weekly downloads that got hijacked to steal Bitcoin. But sure, letās keep installing packages from developers weāve never met for functions we could write in our sleep.
The performance cost is even worse. We ship megabytes of JavaScript to parse a date or check if a number is even. Users on slow connections wait thirty seconds for your site to load because you imported lodash to use three functions. Meanwhile, the browserās built-in APIs could have handled everything you needed, but nobody bothered to learn them.
The maintenance burden is the real killer. Every package can break your build. Every update can introduce breaking changes. Every deprecated dependency becomes your problem. Youāre not building software anymoreāyouāre maintaining someone elseās software that you probably donāt understand, written by people who probably donāt work on it anymore.
The JavaScript community has created a dependency industrial complex. Package authors publish micro-libraries for functions that should be one-liners. Developers import everything because writing code feels like admitting defeat. Build tools get slower because theyāre processing more third-party code than application code.
And the ultimate irony? When these over-engineered, dependency-heavy applications inevitably become unmaintainable, the solution is always the same: remove dependencies, write your own utilities, and simplify the codebase. You know, do what you should have done in the first place.
Weāve lost the plot. Weāve confused engineering sophistication with import sophistication. Weāve built careers on gluing other peopleās code together and called it architecture.
But hereās the thing: the problem isnāt dependencies themselvesāitās our complete lack of discipline around them. We treat npm install like itās free, when every package is a bet on someone elseās code, someone elseās security practices, and someone elseās commitment to maintenance.
The best developers arenāt the ones who memorize every utility function or the ones who install packages for everything. Theyāre the ones who make intentional choices. They know when to write their own code and when to trust battle-tested libraries. They understand the difference between a critical dependency and digital hoarding.
Your users donāt care how many packages you imported or how many you wrote from scratch. They care that your application works, loads fast, and doesnāt break. Sometimes that means writing your own utilities. Sometimes it means trusting the ecosystem.
The trick is knowing which is which.
Think we're wrong?
Good. That's the point. Share your counterarguments and let's have a proper debate.