❄️ Holiday Sale! Now through the New Year, save 40% on Lean Web Club membership, private coaching, and all of my courses and workshops.
Yesterday, one of my students shared some Twitter nonsense where people were predictably complaining that vanilla JS doesn't scale, that using it means you're just reinventing the wheel, and so on.
Today, I wanted to unpack why that's all utter bullshit.
Let's dig in!
❄️ Quick note! Want to level-up your vanilla JS skills? Now through the New Year, save 40% on Lean Web Club membership, private coaching, and all of my courses and workshops.
How do you define scale?
Some people mean, "the code is able to handle lots of requests at once." They think vanilla JavaScript is less capable at doing that than React is.
There's a subset of folks who think that because React uses a virtual DOM it's faster than "the real DOM," and don't realize React eventually has to touch that same real DOM.
Other people mean, "the library enforces patterns that make writing and maintaining code easier."
That kind-of sort-of might be true. But also… if you ask 8 React developers how to approach a problem, you'll get 8 different answers. Hell, the library itself has changed it's mind at least 3 times on how to best manage code at scale. Most established code bases that use it have a tangled mess of patterns.
And those patterns are only as good as your developers' commitment to reliably use them.
You'll have to reinvent some stuff…
Every single project—built with a library or not—involves writing some custom code.
There seems to be a big, common misconception that "vanilla JS" means "I write the entire code base from scratch," which is just absurd.
I use libraries all the time. I'm selective about which ones and how they work. I prefer ones that don't require dependencies on other libraries (that's what makes them "vanilla"), and have actually considered accessibility.
Sometimes, the right tool doesn't already exist. Then, I build it myself.
I fail to see how that's worse than just grabbing some ready-made component that may not do the job accessibly, or that does a bunch of stuff you don't need, or requires you to install another library to work.
Every popular library was a pet project
These people who think vanilla JS is just reinventing the wheel seem to ignore the fact that every single library they love was someone's pet vanilla JS project at the beginning.
Angular already existed when React was built. React already existed when Vue was built. Vue already existed when Preact and Solid were made.
NextJS and Veux were around when Rich Harris made Svelte, and Svelte was already a thing when Astro was made.
Once a library gets inertia, the same people who deride platform-native JS seem to get really quiet about reinventing the wheel.
The web platform already does a lot of stuff
These types of responses typically come from folks who, frankly, have no idea how to actually use the web platform/browsers/the native web.
I meet a love of developers who went through Bootcamps, only learned React, and have no idea how much of what they lean on React for can be done out-of-the-box by the browser.
It's an industry failing as much as an individual one.
Vulturous companies prey on folks who don't know better, charge a ton of money with the promise of getting hired for a six-figure job in 6-months time, and they teach them the quickest, laziest way possible.
It's a bit like a trade school churning out carpenters and plumbers that never learning build codes. But it can happen because our industry lacks any sort of professional certification or regulation.
So…
Yea, my point is, vanilla JS absolutely scales, it's not just reinventing the wheel, and anyone who says that has no idea what they're actually talking about.
If you want to really learn all that the web platform has to offer, don't miss my holiday sale. Now through the New Year, save 40% on Lean Web Club membership, private coaching, and all of my courses and workshops._
Cheers,
Chris
Want to share this with others or read it later? View it in a browser.
0 Komentar untuk "[Go Make Things] Vanilla JS doesn't scale"