3 ms·
I don't know why VirtualDOM is suddenly getting a bad rep. The reason you often want something like a VirtualDOM is so that you can "pre-process" your DOM updat
by gspencley 4y ago
I don't know why VirtualDOM is suddenly getting a bad rep. The reason you often want something like a VirtualDOM is so that you can "pre-process" your DOM updates in-memory so that the actual updates, which are computationally expensive for the browser, can be done more efficiently.
I suspect, but this is just my personal conjecture, that the reason VirtualDOM is suddenly falling out of favour is a reaction against very bloated JavaScript applications and the complexity that underlies working with current popular frameworks and libraries. Some are starting to question whether we are working with solutions to actual problems faced or whether we've adopted approaches that were intended to solve a specific problem faced by some but are inefficient for simpler applications.
As always, be an engineer. Consider all relevant factors before choosing a set of tools or marrying yourself to one technology vs another.
- khmii 4y agoI feel like I live in the Twilight Zone because to me data visualization with a VDOM seems much smoother than without like in Svelte even though data visualization is supposed to be a strong point of Svelte. As someone who has only really got up to speed with React in the past year, I can't understand why people hate on React. Much of the hate has to be residual hate for Meta. Svelte to me seems like a mess. $:variables seems like an absolutely terrible idea. Maybe it is a good idea if you are a genius but I assure you I am not and can do absolutely confusing and crazy things with $:variables.
- gspencley 4y ago> As someone who has only really got up to speed with React in the past year, I can't understand why people hate on React. I'm not sure where the people you are hearing from are coming from, but I can tell you why I personally hate on React. It has nothing to do with VDOM or its underlying tech, it is its design. React gets treated as if it's a framework but is just a view library that gives you the ability to create components. However, even that ability is rather lacking compared to a framework like Angular. Now, people hate on Angular too for various reasons but to stay on topic I won't digress into that. Things I'm missing OUT OF THE BOX (yes I know there are 12 billion libraries "for that" that came out this week alone) with React are: - View encapsulation (styles bound to components) - A templating language that lets me separate a component's markup from its JavaScript - Native typescript - Inversion of Control / dependency injection framework - Native routing that lets me configure my routes as metadata instead of having to use components, which ought to be strictly view / presentation only. Working with inherited React code often reminds me of working with PHP in the 90s. Lots of markup mixed with lots of logical operations written by developers who don't know the first thing about separation of concerns, design patterns or layered architecture but the barrier to entry is low so they picked it up and were able to get stuff done with it despite not having any guidance what-so-ever on how to write maintainable code with a long shelf-life.