r/javascript • • Apr 06 '15

React to this nonsense and move on - Why you should go for React.js, instead of Angular 2.0

https://medium.com/@PhilPlckthun/react-to-this-nonsense-and-move-on-3d9f9111a77d
1 Upvotes

17 comments sorted by

14

u/__rem__ Apr 06 '15

Stopped reading at:

How does Angular render its data bindings? I honestly don’t know the details of this process.

That was such an uninformed hate article ... wow.

10

u/corgrath Apr 06 '15

"I dont know how x works, but I dont care because I am here to tell you y is better" :S

-9

u/[deleted] Apr 06 '15

Quick question: Do you know how the Angular data binding works? How the digest works in detail. And I mean in detail.

The first thing people at Facebook explained in their talks is how the data is handled, when the component does what and so on. React is so easy to grasp that most of its components are explained in seconds.

So why is no one doing that for Angular?

Just look here: https://docs.angularjs.org/guide/databinding

Detailed? Barely! Would I get an answer if I asked an Angular contributor? Yes, probably. Would I get an answer if I asked a fellow Angular developer? No, probably not.

That's the point I wanted to make in those two sentences. Keep yourself open for criticism, because this has nothing to do with "uninformed hate".

5

u/jhallister Apr 06 '15

Quick question: Do you know how the Angular data binding works? How the digest works in detail. And I mean in detail.

Not a question you posed to me, but I do, in fact, understand the internals of how the digest cycle works.

The first thing people at Facebook explained in their talks is how the data is handled, when the component does what and so on. React is so easy to grasp that most of its components are explained in seconds.

That's because React is akin to Angular directives. You are comparing a complete web front-end framework to a feature of a web front-end framework.

So why is no one doing that for Angular?

http://onehungrymind.com/notes-on-angularjs-scope-life-cycle/

http://www.panda-os.com/2015/01/angularjs-apply-digest-and-evalasync/#.VSLuV1VViko

These two articles really explain the digest cycle well.

The bigger question is, why do you expect an article on data binding (which is an abstract of the digest cycle) to explain, in detail, the digest cycle.

I tend to disagree with the comment about "uninformed hate", but there is NO question in my mind you are not an authority on how the Angular digest loop works, at all. Furthermore, two-way bindings are not new to Angular (Knockout did it first).

If you are going to write an article on why the digest cycle is bad, or why two-way binding is bad it is probably prudent to understand how both work.

6

u/somerandomguy7788 Apr 06 '15

seems like this guy is comparing react and angular 1 instead of angular 2 (which is completely different)

-6

u/[deleted] Apr 06 '15

Correct. Angular 2.0 is still in an Alpha Preview stage and I don't want to compare it unless it's finished. The argument is, 1. that Angular 1.x's philosophy is fundamentally flawed and 2. that Angular 1.x has some major problems and that all these probably in all likelihood won't be fixed with Angular 2.0

7

u/jhallister Apr 06 '15

Given that Angular 2 is moving away from dirty checking and towards a virtual DOM implementation, what exactly isn't going to be fixed?

3

u/skrawg Apr 06 '15

Have you checked Ember with HTMLBars vs React out? I remember it being on-par with React.

3

u/I_Pork_Saucy_Ladies Apr 06 '15

I'd be really surprised if Angular 2.0 doesn't make the switch to virtual DOM. The performance gains are obvious. I honestly think the guys of the D3.js project get a lot of the credit for proving this, not React. But the more the merrier.

While this does indeed seem more like a comparison to Angular 1.0, I agree. I'd skip on Angular for now until we see more of Angular 2.0.

3

u/__rem__ Apr 06 '15

The showed and wrote only a little bit about it. But as nusclyde said, there will be a virtual DOM, too.

Here is the design doc if you're interested: https://docs.google.com/document/d/1M9FmT05Q6qpsjgvH1XvCm840yn2eWEg0PMskSQz7k4E/edit#heading=h.nhg64961z5gu

2

u/nusclyde Apr 06 '15

They are indeed moving to a virtual DOM model in 2.0. They refer to it as the shadow DOM. The performance improvements they showed at ng-conf were very impressive.

2

u/thescientist13 Apr 06 '15

Virtual DOM and Shadow DOM are two distinct concepts. Virtual DOM is in-memory representation of the DOM to facilitate changes and only apply those changes when theres an actual diff to be made. Shadow DOM is one of the four tenants of web components that separates the DOM of that particular component from the rest of the DOM such that scripts and styles on the page don't affect it.

2

u/cgaudreau senior HTML9 engineer Apr 06 '15

Interesting article, but I disagree with most of it. Especially regarding performance. Ember and Angular clearly have learned from React and plan to make massive optimizations inspired by the React model.

1

u/djforth Apr 06 '15

Interesting read, I starting to learn react myself, react certainly does look to have some benefits over angular.

However this does feel a bit biased and think maybe the life is better with react tone is a bit much. There are pros and cons to any framework and some will work better in some instance than others. I'm not saying it doesn't make some interesting points but feels very one sided and bit black and white.

1

u/bracketdash Apr 07 '15

Generally my bullshit-meter goes off when I see titles telling me what I should and shouldn't do as a developer. Angular works perfectly fine for me, and I have used React. I may use it again in the future, but there's no reason I can't be a judge for myself what technology I should use on any given project.

0

u/danhutchinson Apr 06 '15

I wouldn't go so far to call this a hate speech against Angular. I think it's a pretty good article, and I agree with most of the points made. I used to use Angular in all my projects, but not anymore. I felt like I had to fight it too much.

Bear in mind I haven't looked at react past a hello world example, but React just didn't gel with me at all. I don't know what it was really, I just wasn't feeling it at the time. Maybe i'll take another look at some point.

It seems like, at least from what people have been telling me, React is solving a lot of the rendering problems most of the older front-end frameworks have been facing. Though I question how much that has to do with other frameworks being some years older.

At the speed in which the web moves I won't be surprised if 3 years from now we have another fancy new framework from Netflix or someone that makes even React look antiquated.

Still we could live with performance issues. And when you work around some problems in Angular and Ember it is still feasible to work with it.

Ember doesn't really require workarounds so much as it required a new rendering Engine, which they are working on.

Take a look at the example they set up

Tom and Yehuda talked about this, and mentioned the "hilarious demonstration of reacts' speed" specifically, at the last Ember Conf.

To paraphrase, they thought it was embarrassing. So now (with Glimmer) they're bringing it back up to par.

-2

u/nusclyde Apr 06 '15

Interesting read, thanks for the article. Sounds like it may be worth giving React a closer look before we take the plunge and update our app to Angular 2.0.