Hacker News new | ask | show | jobs
by windows2020 1607 days ago
The Right Thing

I've heard people say, "React is fast. It has an intermediate layer to optimize changes to the HTML. You get much better performance with it." Of course, we know that effectively manipulating the DOM via plain JavaScript is the best you'll get. (And you can achieve great performance with well written jQuery too.)

2 comments

Agree. I did a web application where all views were defined in the HTML file, all disabled except for the current view. The app would then switch views by simply enabling/disabling views as needed. It was super fast. And keeping the views up-to-date was easy. The app simply updated all views when the data changed => the visible view and all non-visible views would always be up-to-date without needing any special handling or virtual DOMs. Super simple. Super fast.
> Of course, we know that effectively manipulating the DOM via plain JavaScript is the best you'll get.

With an infinite amount of hand-tuning by experts, yes. In practice to know what parts of the DOM to update based on what changes and maintain that mapping correctly as your system evolves, you have to either use React or use/build something equivalent to it.