Angular vs React, Round 1

Daniel Chang
Always Be Coding
Published in
3 min readSep 14, 2016

--

I recently did a project in Angular, and given I had done some work in React before I thought it would be a good opportunity for a quick compare and contrast. Keep in mind, this is just a surface level, initial impression of both.

Angular

To be clear, I’m talking about Angular 1 here. Angular 1 has technically been around since 2010. I actually cut myself on React before looking at Angular though. So there maybe some React first love bias, but honestly probably not.

Dirty Two Way

You can’t talk about Angular without talking about two way data binding & dirty checking. Frankly, I’m kind of meh about two way data binding. While it is pretty cool to have, I haven’t found it to be an insurmountable advantage over one way binding in React. If anything, I see two way data binding not scaling well from a developer usability standpoint.

Dirty checking on the other hand I love.

I Miss HTML

I can see how getting an application off the ground in Angular is much quicker than in React. While two way data binding plays a role in that, I think how close Angular is to HTML has a larger impact.

Angular really is how HTML should be extended to support web applications. Being able to directly use directives and call methods within the HTML allows the process of putting down code go much smoother.

React

React is the newer kid on the block, and he got pretty popular pretty fast.

While React doesn’t tie as closely to HTML, it does compile from JSX which allows markup to be directly written into the code. While on paper this sounds almost as good, it really isn’t. It is light years ahead of something like Backbone, but it just doesn’t feel as cleanly tied to the HTML as Angular does.

One Way Only

You also don’t have two way data binding out of the box. I’ll be honest, I couldn’t care less. There is a few extra lines of code I need to put to get certain things working, but I didn’t mind. In fact, I actually liked it more.

With Angular the flow of data is a bit abstract. While you are coding close to the HTML, the data is in components, factories, services, or what nots. These concepts are pretty abstract from the HTML elements themselves.

In React your data is passed through components as states and props. Each component can have children component that data can be passed to. This structure makes the data flow more in line with the HTML elements. Even though you are not coding directly onto the HTML, your data flows along the DOM more than in Angular. It feels more intuitive.

Conceptual Comparison

Anytime you compare Angular and React it’s important to address the conceptual difference. React positions itself as a View in the MVC framework whereas Angular positions itself as the MV* portion.

Having different conceptual standpoints obviously means they excel at different things. To blatantly say one is better than the other would be short sighted.

With that said, I have to admit I prefer React more at this point in time. While I see huge advantages with Angular, React just feels more intuitive. We’ll see if that opinion holds moving forward.

--

--

Code monkey always looking to learn more, avid car enthusiast celebrating #WRXmas all year long, amateur chef, professional eater.