|
|
|
|
|
by austin-cheney
748 days ago
|
|
80% agree. That is immediately true when only talking about code, but then absolutely everyone bitches about how shitty the result is (big, slow, brittle, and so on). People do care enough to complain, even non technical people. Worse than that people who do that work also bitch about how shitty the results are too, but then continue writing garbage because that’s the best they can do. |
|
True, but the only solution to this is "get good". Because using vanilla JS isn't going to make them any less likely to make a foot gun.
In my experience, the most brittle projects I've worked with tend not to be component-based SPAs. Maybe not necessarily because they're SPAs, but because they're component based, which in JS world, pretty much always requires the use of ES modules.
Even if someone makes some horseshit you can iterate away from it easily because (at least in the case of Vue), it's incredibly difficult to leverage global state (and discouraged, in programming in general, but also specifically bt Vue) and everything you do is encapsulated in components.
The JS projects that give me nightmares are the ones that use globals that are defined/populated/hydrated across different JS files, so the JS files have to be loaded in a certain order, or you get undefined reference errors and the like everywhere.
All of this is sorted out for you by bundlers and frameworks. And if you're not using a framework, you almost have to be good enough to make a framework to avoid all those pitfalls yourself.
At least that's been my experience with vanilla JS vs. framework JS in enterprises.
I really think the web purist rage about it comes from the fact that these individuals have dedicated years to perfecting exactly this craft (building little frameworks for themselves) and now complete noobs can make websites that look equally as sophisticated in 5 minutes. I don't think it really has to do with practicality as they claim. (E.g. gatekeeping)
Many webpages can and should exist with as little JS as possible, but the moment UX matters more than whatever bespoke concern is causing that restriction, you start having to think about the JS as a full fledged app vs. just some scripts bringing life to HTML (or you just delegate a bunch of UI code to the server).
I think if the website is primarily for reading static content, it makes sense not to use a framework. But once you are managing forms, reactivity, and rapidly changing demands from user feedback, it stops being easy to balance between creativity/flexibility in design and robustness.
And the reality is, most web developers are just working on some version or component of an ERP, which is a reactive data driven app that changes constantly to keep up with the business it's built for.
Frameworks usually facilitate rapid iteration in such products.
But I agree, installing 40 npm packages to build a blog is silly.