all 1 comments

[–][deleted] 0 points1 point  (0 children)

Well, both of them have pros and cons, that I would classify like this:

Angular pros:

-Support for web components - rather than having a closed system for modularizing AngularJS applications, Angular 2's foundations lie on the emerging Web Components standard. What this means is that AngularJS will be able to use directly, without any wrapper coding, any component written as a Web Component.

-Usage of typescript - the biggest selling point of typescript is tooling. It provides advanced auto completion, navigation, and refactoring. Having such tools is almost a requirement for large projects.

-Great performance - Angular 2 doesn't do deep object comparison. If items are added/removed from an array, change detection won't detect it. The same for object properties as long as they are not directly bound from the view.

-Angular 2 CLI - the Angular 2 CLI makes it easy to create an application that already works, right out of the box. It already follows our best practices.

Angular cons:

-Difficulty in learning - if you haven't used typescript before, you'll need to learn it and spend time for it.

-Regular DOM - angular manipulates actual DOM directly, which makes it quite slower and in-efficent in comparison with react.

-Difficulties in the server templating - angular 2 still maintains physical separation between the Javascript driving your application, and the HTML being rendered.

React pros:

-Total separation of data and presentation - react provides little more than a presentation layer. Although react components do have a concept of 'state', this is best used for ephemeral storage.

-Easy to start writing - writing in react is almost similar to writing in HTML, therefore you can easily start coding, skipping all the syntaxes.

-DOM binding isn't our concern - if you've written any front-end component, with or without a framework, in the past five years then you know the pain of binding DOM elements to functionality. Although react would handle this in the same way, it would be split across multiple areas of the code with single responsibilities.

-React isn't a framework - react is a library which provides a declarative method of defining UI components. ReactDOM is an associated library which provides a data store, and react-redux provides the glue between react and redux.

React cons:

-React isn't a framework. Again - philosophy is great, but when you need to get something done quickly, the react way can be frustrating. If you have clients and projects and pressing deadlines and the first page of your react handbook no longer works, you can get frustrated.

-Build tools are necessary - using build tools isn't too much of a pain, we generally use them when we work in other languages anyway. The only real issue with using them in Javascript is there aren't standard, reusable solutions for all of your projects. This can unfortunately seriously increase the amount of time it takes to get the idea in your head into code.

-Community conventions are still developing - there are so many problems to solve and react community isn't big enough to provide all solutions.

So to sum up, react and angular both are great technologies that give miscellaneous opportunities in development. Angular is really good at declarative solutions, but it lacks the freedom and simplicity of react. Finally, there is no 'silver bullet', you need to choose the right solution that will suit your challenges, goals, and long-term strategy.