r/javascript • • Jun 01 '15

Is ReactJS faster than AngularJS ?

http://blog.500tech.com/is-reactjs-fast/
22 Upvotes

47 comments sorted by

View all comments

Show parent comments

13

u/jhallister Jun 01 '15

It will never cease to amaze me how quickly people turn from in-love to "this is literal hell". I remember when I first started working with AngularJS and everyone was swooning and now a new shiny toy is out and the hatred is extraordinary.

Yes, it's easy with little 5-line code snippets, but try doing so in a reasonably-sized application

I've been on teams that have built AngularJS applications of enormous size. It isn't hell, at least, if you actually spend the time to understand how to properly use Angular. It's certainly not always straight-forward, but hell != difficult.

How to optimize a React application: Implement shouldComponentUpdate. Or if you want performance by default, just use immutable data structures.

If you honestly believe a large team developing a large application can shove immutable.js in it and get production-ready performance than you clearly haven't programmed large applications.

Furthermore, why are you comparing a view-manager (React) an entire front-end framework (AngularJS)? No $broadcast or $emit? Events have nothing to do with performance, but they are the antithesis of good Angular design. You should do $digest if you need watchers to fire in the current scope only, you should use $apply() when you want the root scope (all watchers) to $digest().

The one and only real problem with Angular was always the same: the docs were really, really bad. As a result a lot of people simply couldn't learn the framework, or at the very least couldn't learn to use it well. Some couldn't because learning without good documentation is tedious. That's a very fair argument.

The downside, however, is that it's now vogue to talk about how horrible AngularJS is and list off a bunch of grievances, the majority of which show that the person really didn't learn Angular, for whatever reason.

React is a great view manager. It has a host of problems as well, and more of those problems will become apparent when the framework ages, much as they did with Angular. And undoubtedly, we will eventually come full circle and have people whining about how horrible React is compared to JesusFramework 1.0.

Honestly the real reason, webdevs just like to whine about something.

END BOOK/RANT

2

u/michaelstripe Jun 02 '15

I'm honestly curious what the host of problems you find React has.

I'm kind of jumping between Angular and React for two projects and I'm not sure I'm sold on either, but all I read about React and Flux (and soon to be Relay and GraphQL and whatever the hell else) is unfaltering praise and never any good criticism. I would love to see more opposing viewpoints for the above.

1

u/jhallister Jun 02 '15

A few problems:

  1. Psuedo-javascript language for templates.

  2. Animation support is weak. Most animation tools are pure JS animations.

The biggest issue I have is that React = Virtual Dom. The rest is just opinionated templating and organizational stuff. React hasn't been out that long and I honestly think that big picture Mithril took the same idea and implemented it much better.

Full disclosure: currently using Mithril on a project. I've used ReactJS on a medium sized project and still think it's a VERY good view library.

1

u/michaelstripe Jun 02 '15

Mind going over what you like more about Mithril? Never gave it a good look.

1

u/jhallister Jun 03 '15

It doesn't really try to invent "the new best way". It's just a MVC framework that happens to use a a virtual DOM. It also happens to be really small.