3 ms·
I think everyone should know how the DOM works under the hood but the HN hate for frameworks and love for vanilla JavaScript is just unbelievable. As soon as yo
by Kiro 7y ago
I think everyone should know how the DOM works under the hood but the HN hate for frameworks and love for vanilla JavaScript is just unbelievable. As soon as you venture past small JavaScript sprinkle you will regret using vanilla. It feels like a made-up opinion by people who are actually not developing front-end JavaScript seriously. The DOM API is simply unfit for real web apps without a proper framework on top.
- cloverich 7y agoIts hard to see why the JS frameworks came to be, and easy to see the up front complexity of most of them. People who started before good frameworks were around take it for granted that people know what happens when you build complex sites with vanilla JS: You get a mess, or you get your own framework.
- marcosdumay 7y agoNot everybody wants to render everything on the client. JS frameworks (vue included, despite trying) do just not support rendering as a simple page. Some people do have light needs that won't ever require a full framework. Other people have very heavy needs that will require their own frameworks. The JS ones (react included) are not absolutely flexible. And, if you fit none of those categories (honestly, most people are on the first), just replace the title with "how does a JS framework operate on the DOM", and take it as a learning resource.
- Kiro 7y ago> Not everybody wants to render everything on the client. No, and then you should just render it on the server. Most "apps" should not be JavaScript apps at all. However, once you do need to enter that territory you should definitely use a front-end framework.
- robertoandred 7y ago> JS frameworks do just not support rendering as a simple page. What is this supposed to mean?
- nepeckman 7y agoAgreed. The only way vanilla JS scales to a large codebase is through serious discipline and internal tools, essentially creating an ad hoc, poorly specified, home grown framework. Even the web components standard is insufficient without abstraction layers on top.
- krapp 7y agoNot all codebases are large, and not every site is, or needs to be, enterprise scale. I think HN sometimes forgets that there's an entire web outside of FAANG+ and startup culture that doesn't care about any of that.
- Kiro 7y agoI don't think you need to be enterprise scale to justify using a front-end framework. Anything above trivial complexity is enough and it will give you headroom to scale as a bonus. I think a more common mistake is to use a framework when you could just as well render it on the server with the same result and being simpler at the same time. But when you do need to create a dynamic web app, you should definitely use a framework. Using vanilla will just result in you creating your own half-baked framework anyway.