HN2new | past | comments | ask | show | jobs | submitlogin

I just don't understand React, it makes things slower, less responsive, just a worse browsing experience in general all to serve json instead of html. The user experience is worse and the developer experience is worse.

React was invented to save facebook money on the billions of requests they get by sending minimal json data and having JavaScript do all the rendering. Under facebook I can understand it because it will save them millions in bandwidth but for 99.99999% of other websites it makes no sense.

Also another reason for React was to devalue front-end developers and make them easier to replace.



It's not about the rendering. It's about making sure all the state of the UI is consistent. That when textbox A is changed. All the places in the page that depend on that value are updated. You can do it without react but it's a real pain.


Apparently Facebook can't do it with React either. They still experience the exact same state inconsistency bug as described [0] during React announcement as rationale for using React.

[0] https://www.youtube.com/watch?v=nYkdrAPrdcw&t=887s


Managing state in the frontend is the worst, no matter the framework. I understand why a large company like Facebook wants it to be done client side, but for the rest of us, I'd argue its nowhere near worth the hassle.


Yes, the problem isn't react, it's the notion that every website needs to be an application, or that sites serving articles (a large part of the web) need a UI.


The whole point is not doing the rendering on Facebook servers but on the user terminal.


I make dynamic apps and I have never had this issue with state. I've made visualization generators, image editors, live charts and html editors that run in the browser. the stuff I'm making has a lot changing elements and handling the state is not an issue for me. Maybe it's because I learned programming from game development I see web dev with a different perspective?


So 10 years ago when React was made public the default way to handle changes on the web was to have a bunch of event handlers that would go over the DOM and make appropriate mutations.

That's kind of typical of retained mode user interfaces. To this day that's kind of how things like QT and GTK kind of work. There are things like data binding, etc. But that's what they do under the hood.

When you are working like that it's easy to forget to do mutations on specific UI components or to make mistakes about the mutation that has to happen.

React handles the mutations, it takes your code, feeds it the current state and gets back what the ui should look like, and then it does a diff with what's on screen and updates accordingly.

If you are coming from game development you are probably used to immediate mode UIs where you specify and update the entire user interface every time.


How do you know how to repaint the screen when a variable changes without blocking the UI?


To slightly refine your question. When a variable changes how do you know which UI elements have to be updated? I think his answer is obviously all of them.




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

Search: