Why don't more developers “use the platform”?
The Paradox of the "Platform": Why Developers Resist Native Web APIs
For a long time, the champions of accessibility, performance, and web standards have been preaching a simple mantra:
"Just use the platform."
The logic is straightforward: why waste time engineering a custom solution in JavaScript when the browser already provides a native implementation? Generally, a native feature will outperform a JS-based workaround and offer a more seamless user experience.
However, it is worth exploring the perspective of the "platform-skeptic." If the benefits are so obvious, why is there such a persistent need to convince developers to stop using libraries and start using the browser?
1. The Weight of History
The primary reason is historical. For decades, the browser ecosystem lagged behind the needs of developers.
- The Gap-Fill Era: Libraries like jQuery weren't just preferences; they were necessities that filled massive holes in browser functionality.
- The Laggard Problem: Even when standards existed, developers had to wait for
Internet Explorer 6and other slow-adopters to vanish before native APIs were viable.
While we now live in an era of "evergreen" browsers (though Safari's update cycle is slightly more sluggish), the memory of a "lumpy web" persists.
2. The Ecosystem Gravity
Familiarity breeds habit. When a developer's primary instinct is to search npm for a React component, that becomes their default problem-solving path.
| Feature | The "npm" Approach | The "Platform" Approach |
|---|---|---|
| Discovery | Search npm Install package | Search MDN Implement CSS/HTML |
| Ergonomics | High-level framework primitives | Low-level DOM/CSS APIs |
| Documentation | Detailed READMEs, tutorials, screenshots | Technical specs, MDN, web.dev |
| Dependency | Adds to node_modules | Zero overhead |
If you search npm for "sticky positioning," you won't find a package that tells you: just use position: sticky, you dolt.
Interestingly, many React developers find raw DOM manipulation "icky," yet they happily install libraries that perform those exact manipulations under the hood for the sake of performance (e.g., virtualized lists). This creates a division of labor: experts wrap complex platform APIs in familiar, high-level components for everyone else.
3. The Psychology of "Building it Yourself"
Beyond convenience, there is a psychological element. For many, the act of creation is simply more fun.
The IKEA Effect
There is a specific satisfaction in tinkering with your own code. This "IKEA effect" makes developers want to maintain and refine their homemade solutions rather than using a "black box" native element.
The Learning Curve
Consider the process of building a Modal Dialog. A developer might start with a simple visual goal, but quickly realize the complexity involved:
- Position the element using
position: absoluteandz-index. - Prevent the background body from scrolling (
overflow: hidden). - Implement the
Esckey to close the window. - Create a focus trap for accessibility.
- Return focus to the trigger element upon closing.
While this sounds like a nightmare to some, for others, it's a journey of discovery. Adding custom animations or themes transforms a boring task into a project worthy of its own npm package.
4. The Path to Mastery
Ironically, the people currently shouting "use the platform" are often the ones who spent years not using it. They learned the web by building the very polyfills and shims that are now obsolete.
The author's own journey is a prime example:
Problem (Platform Gap) $\rightarrow$ Build Tooling $\rightarrow$ Deep Expertise $\rightarrow$ Standards Contribution
Working on PouchDB and browser storage APIs (like IndexedDB and WebSQL) provided the motivation to eventually participate in W3C meetings. Without the "forcing function" of a missing feature, that level of expertise might never have been reached.
5. The "CSS is Hard" Problem
Of course, avoiding the platform isn't always a positive learning experience. A huge amount of JavaScript is used to solve problems that CSS could handle better, simply because CSS is historically unintuitive.
We can model the "Developer's Choice" as a function of perceived complexity:
When the denominator (CSS complexity) is too high, developers default to JS. This is why sites like CSS Tricks exist; concepts like the clearfix, floats, or the min-width: 0 hack are not naturally intuitive.
Rather than trying to master the arcane arts of CSS, many developers simply reach for a JavaScript library that feels more predictable.
Summary of the Conflict:
- Advocates: Focus on .
- Skeptics: Focus on .