4 ms·
You can still do all that in JS, novel syntactic sugar aside.
by kizer 7y ago
You can still do all that in JS, novel syntactic sugar aside.
- austincheney 7y agoHe/She cannot do that, at least at their employer, because people would throw up at the sight of the code and cry until its rewritten. As an example slip some DOM methods into your code and watch people go into convulsions like an angry zombie on cocaine.
- ritchiea 7y agoThere are very real reasons not to use DOM methods assuming you're using a front end framework. Not only is the coding style more imperative than say React, but frontend frameworks have been designed to efficiently update the DOM and have diffing algorithms that can check for necessary state changes. Is there really a compelling reason for writing your own DOM manipulation in a sizeable frontend codebase in 2020?
- austincheney 7y ago> Is there really a compelling reason for writing your own DOM manipulation in a sizeable frontend codebase in 2020? It is several orders of magnitude faster. It’s also how I prefer to code because managing state isn’t challenging and I am not hopelessly paralyzed by imperative code.
- pepper_sauce 7y agoMaybe they don't want to force their users to download several MB of framework libraries in order to use their website. DOM manipulation is perfectly fine for interacting with styled documents, the web's forté. If your website amounts to a set of configuration forms and a blog then you probably don't need React.
- erikpukinskis 7y agoYou can turn a bar into a dance club, and I can still drink there. But it’s a little academic to suggest that. That said, I’m am quite free to choose not to install npm packages that use Babel or Webpack, and I that’s what I choose when I have a choice. Certainly don’t have that choice at my work.