Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> React uses a virtual DOM to avoid DOM unnecessary manipulation, which is slow and error prone.

While it may be the case that DOM is far from perfect, React is hardly the only way to avoid it. Even if for your use case avoiding DOM manipulation is necessary (which I strongly suspect is not true for like 95% of people who use React as the framework du jour), there seem to be significantly better thought out approaches, like for example Svelte, if you absolutely have to go down the "let's turn our browser workflow into a C-like one" road and churn out an opaque blob of code as a result. That also avoids unnecessary DOM manipulation, but unlike unnecessarily duplicating browser data structures is at least somewhat elegant, just like compilers are considered elegant compared to interpreters.

> React and Redux use that to their advantage, rather than insisting everything be modeled by classes.

Sure, but Javascript is not even based on classes. It traces its heritage back to Self which doesn't even have classes.



Avoiding direct DOM manipulation is a benefit in almost any case. Virtual DOM is now at the root of most popular UI frameworks libraries, including Vuejs and Angular, also less popular WASM ones like Blazor(C#) or Percy (Rust).

I do remember writing complex JQuery components. React felt like a liberation for me...


But because JQuery was bad doesn't mean that React was the answer. That would be a false dichotomy to make.


Interpreters are considered elegant, too. For example, Lua is a great little language and it runs everywhere precisely because it's interpreted.


Sure, there are many elegant interpreters. I'm not sure that patching DOM from the changes in a redundant data structure is one of them. Even Blink's idea to instead pull browser's own DOM into Javascript definitely looks saner to me.


It's not a redundant data structure if you need it to figure out the necessary changes.

You are free to choose other approaches for your frontend projects. Just don't expect to get hired into larger teams easily.


> It's not a redundant data structure if you need it to figure out the necessary changes.

And why exactly can't you "figure out the necessary changes" without it?

> Just don't expect to get hired into larger teams easily.

Honestly, I see that as a win-win.


Seeing how much you like trolling, that is not a surprise.


Sincerely held opinions are by definition not "trolling". I just fail to see that as relevant, just as I fail to see the number of Big Macs being sold globally as being relevant to food choice criteria.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: