Hacker News new | ask | show | jobs
by sjcrank 3798 days ago
In my experience the performance benefits are when comparing React to other libraries/frameworks that also provide some level of developer ergonomics. In particular, during the early days of React, it provided great performance in contrast to AngularJS. Not so much when compared to well-written raw JS/jQuery.
2 comments

Agreed I believe the performance perception is an outgrowth of following on the tail of Angular which was a significant step back in performance from the frameworks and toolkits that proceeded it. Prototype, Dojo, YUI, jQuery et. al. did not suffer from significant performance problems for the run of the mill problem domains. Granted the early frameworks where more focused on components than application architecture but even Backbone did not suffer from the abysmal performance problems that plagued Angular.

One issue I have with the article is that it reads like React was the first framework to bring componentized and encapsulated UI elements to the party, when in fact that was the norm for frameworks before Backbone and Angular. Specifically Dojo and YUI where heavily focused on components.

An honest question on this: how much are these touted benefits around ergonomics, code-reduction, and simplicity are relative only to Angular or vanilla JS?

Our shops avoided Angular altogether due to the complexity with larger apps, and used few other frameworks and libraries instead.

Trying various real world React examples frankly seems to involve more code, and the learning curve for React+Flux/redux/etc is really not trivial for a lot of people.

In my opinion, there's nothing wrong with using raw JS/jQuery for projects - with discipline you can keep the code performant and well-structured. On the other hand, I have found real benefits from React as the project grows in size (current SPA is 50k lines of code).

Overall, my recommendation is to use the simplest approach that works, and start adding libraries/frameworks only when they add clear value.

Thanks, yes to be clear we did use libs like Knockout, handlebars, requirejs; and more recently have been using Babel/Webpack with RactiveJS, Riot, et al. React is nice, but it's not clear that it's "better" imho.
It sounds like you might be in the right place to benefit from vue.js -- kind of a modern/simplified knockout. Super lightweight, very easy to learn, and just a view layer so it's not dictating your overall app architecture.
React/Redux is definitely more work. Having to go from just mutating state locally to dispatching actions and composing reducers also involves a big shift in thinking.

On the plus side: - It makes applications significantly more declarative, which is a readability win for me - It simplifies applications with rich history awareness. - It is fairly easy to reason about (particularly as compared with Angular) and debug. I find it conceptually more straightforward than backbone as well.

As a back end developer, I got further with React than I did in Angular or any of the others I tried. Sure Angular does a lot more, but a good deal of it is stuff that should be done server side anyway.