Hacker News new | ask | show | jobs
by sheeshkebab 2945 days ago
React has a lot of inertia behind it, although it doesn’t really make things easier.

The amount of js code to make even basic things work is high, and with so many different styles of writing react/js code, large codebases require significant effort to keep maintainable.

Which is to say, with this much effort put into structuring maintainable react js code, one could pretty much develop in any js ui framework (including jquery, backbone or none whatsoever) - since little of this effort is dependent on react, or made easier by it.

3 comments

Virtual DOM and ability to derived your DOM state from props and state is not something you can easily done with jQuery or any UI library that doesn't have that concept.

It's not something you can easily implement yourself either.

That's the main part that makes React code maintainable.

I agree, this is the part that people seem to be ignoring. Yes, you can make a proof of computational equivalence between jQuery and React, but you cannot deny the massive increase in human usability that an set of components brings. There's far more interesting set of things you can do, Redux + the litany of other related libraries, a vibrant ecosystem unto themselves, prove this. I started my career out slinging jQuery and after 4 years of React I never want to go back.
Maybe development requires more overhead, but you have to factor in reading understanding and maintenance. React, with a proper state management library like React, in my humble limited opinion, is easy to understand because of its functional nature. The view rendering is a function of the props it receives, whether it come from a context based store like Redux or just passed thru. I don’t find reading other peoples React code terribly difficult because most of it is not surprising. Even components which make heavy use or internal state are never so terribly difficult to understand.

I don’t think the same could be said of your random JQuery or. Backbon based project

I disagree. Bridging the concerns split between between HTML, JS and CSS helps a ton and would be a lot of code to write if not for React (or similar frameworks).
I feel this is because many people confuse Redux (or flux) with React itself.

Or the more general problem of not knowing the difference between store state, local component state, and component instance state (the actual JS object's properties.)

The new Unstated library leveraging the next Context API is a nice balance I find for state management. It basically just mirrors Reacts setState style update system. Although you do lose the single source of truth pro of Redux.