The Gardener's Impatience: On the Hasty Uprooting of a Perceived Weed

There is a mantra whispered in the halls of front-end development, a piece of received wisdom so ingrained it has become almost sacrosanct: 'JavaScript is the enemy of performance.' We are taught to see it as a blight, a sprawling, untamed weed in the garden of our web pages, to be pruned, deferred, and eliminated wherever possible. This instinct comes from a good place—a desire for speed—but like an overzealous gardener, we risk pulling up the very roots of interactivity and life in our haste to tidy the beds.

This wholesale condemnation creates a strange and counterproductive puritanism. We begin to treat all JavaScript, from the tiniest event handler to the most complex application logic, with the same deep suspicion. We banish it to the bottom of the page, defer its loading, and slice it into precarious bundles, all in the name of a faster First Contentful Paint. But in doing so, we often forget what the paint is for. A page that paints quickly but cannot respond to a click for three seconds is not a performant page; it is a painted tomb.

The Cost of Deferred Life

The dogma of 'JavaScript bad' leads us to architect for loading metrics, not for people. We celebrate a stellar Lighthouse score while the user taps futilely on a button that has yet to become functional. We have optimized for the moment of arrival at the expense of the entire visit. The JavaScript that powers a search filter, a cart counter, or a critical modal is not a weed; it is the circulatory system of the experience. By deferring it all indiscriminately, we introduce a different kind of instability—not of layout, but of expectation. The page looks ready but is, in fact, a facade.

This is not a plea for bloated scripts or careless single-page applications. It is a call for nuance. Performance is not a single number but a spectrum of perceptions. Time to Interactive is just as vital as First Contentful Paint. The true craft lies in discernment—in knowing which scripts are the weeds and which are the vital perennials. Critical interactivity should be inline, small, and purposeful. The larger, application-defining bundles can and should be deferred. This selective approach requires more thought than a blanket policy, more artistry than a simple edict.

Let us move beyond the simplistic war on all JavaScript. Let us instead become more thoughtful gardeners, understanding the role and timing of each element in our ecosystem. Performance is not achieved by merely removing things, but by carefully curating them. A fast website is not one that is merely painted quickly, but one that comes to life precisely when the user needs it to.

Notes & further reading

A few pages I came back to while writing this: