DEV Community

Discussion on: Why Virtual DOM?

 
aidenybai profile image
Aiden Bai

I see, personally I would prefer the best performance, but to each their own. I'd like to see the example if you ever get to find it!

I think I misinterpreted your statement there, I thought you were talking about React when you remarked about the "hassle" part.

It can also be noted that using any technology is a comprimise - for example, using DOM nodes generally constrains you to imperative programming, and Svelte constrains you to it's own syntax, while providing extreme performance. I think a better phrasing could be "a means to an end" to provide declarative programming.

Thread Thread
 
lexlohr profile image
Alex Lohr

You're right.

Every library and even using no library is a compromise between time, performance and features (maintenance costs time, so a library that makes it easier will save time).

I'm currently using react at work and it's a rather good compromise, because we work with 4 teams of varying experience on a very complex application.

But back to the original point: a virtual DOM is not a necessity, but merely one way to solve a certain set of problems – and in some (but not all) cases, other solutions might be a better fit.

Thread Thread
 
aidenybai profile image
Aiden Bai

That's a good way to put it, I just rephrased the title of the article so it's a bit more vague, but no longer claims that it's a necessity. Thank you!