
Virtual DOM is not a feature - tdurden
https://uniphil.github.io/virtual-dom/
======
lopatin
I think the beginning of this article is spot on. A declarative UI library for
the web needs to have something like virtual DOM so that the actual DOM is
strategically updated when a higher level component updates. No DOM state like
input focusing is lost. The part that I don't understand is when the author
mentions that the "nifty algorithms that operate on the Virtual DOM" are the
key to React's speed. It was my understanding that 1: There are no algorithms
that operate _on_ the virtual dom. It is blindly updated every time a
component update happens. And 2: That the algorithms that compare the virtual
dom and the real dom are the essence of the "Virtual DOM" idea. In this sense,
React is no different from the other declarative UI frameworks out there and
this is where the point of the article was lost to me.

------
jhall1468
> Does this difference in semantics matter? Probably not. Even React's own
> documentation gets it wrong.

First of all, if you are arguing that they're different things then it isn't a
argument in semantics. Secondly, the docs don't get it wrong. Conceptually it
presses the refresh button... there not saying it literally presses the
refresh button.

That said, I liked the example of making it slow. Perhaps it's just my mind
playing tricks on me but the button counter felt slower when clicking it
rapidly. Pretty amazing that such a bare-bones example "felt" different.

------
mercurial
My problem with this article (apart from the title of the submission) is that
the author's point is, IMHO, not very well thought out. It's not a question of
"using the virtual DOM or not", it's a question of "use immediate rendering"
(what the author attempts) or "use a diff-and-patch algorithm" (what React
does).

------
ludamad
Why the more strongly worded title?

~~~
tdurden
The title in the article changed after submission.

[https://github.com/uniphil/uniphil.github.io/commit/230de9cf...](https://github.com/uniphil/uniphil.github.io/commit/230de9cf6a1e41cabb8b9406446eb0c424034cd8#diff-8018522fe7d646a82658459f346f8029)

