8 ms·
A more useful question to answer would be should I use Angular or React?
by smegel 10y ago
A more useful question to answer would be should I use Angular or React?
- tracker1 10y agoAre you okay picking your state management paradigm, and additional tooling? Are you more functional or OO minded. Do you lean towards TypeScript/static typing? Do other people you are going to be working with have experience with either of the tools/platforms? For me, imho React + Redux + fetch api go a really long way to get you there, combined with material ui, or react-bootstrap with react-icons you're all but set for getting started. The boilerplate can be painful at first. I found getting Angular up and running (before their cli) was really much more painful... It's gotten better. I just don't like the indirection and the angular templating dsl. I find JSX and feature organizational structure much easier to accomplish and grow with in React. I find that Redux is a great middle ground for a unidirectional state management paradigm (combined with async functions and redux-thunk). Redux has some more cognative overhead in getting started, but once you have it, growing it is all more of the same, instead of leading to a path of spaghetti. I don't think TFA really answers if it lives up to the hype, I think the hype has died down at this point, and a lot of people are wanting to move on.
- jamra 10y agoTo add to your point, I feel that React/Redux is easier to debug. Redux has the developer tools, which allow you to rewind state as well as hot module reloading, which means you can rewind state, and then replay it with your code changes. This means you don't need to log back in to your app, navigate to where you were previously at, and then recreate whatever extra state each time you try a fix. The functional approach via Redux is what a lot of people look at, but I prefer to look at the developer tools and the state of debugging. JSX is easier for me to debug since you can just drop breakpoints in your javascript and step through with the debugger. This encourages more vanilla javascript usage, which is easier to debug and reason about.
- rpeden 10y agoYou can use Redux with Angular 2, and it works quite well! The dev tools work the way you'd expect them to. Webpack hot module loading works well Angular 2 as well. I agree that JSX is easier to debug. The Augury[1] Chrome extension serves the same purpose for Angular 2 as the React Dev Tools extension does for React. That's not to say that React isn't great too! I like it lot. [1] https://augury.angular.io/ https://augury.angular.io/
- tracker1 10y agoHow does it do with synching your route state with the redux store? I remember when I played with it (think routing has been replaced twice since) that was the real beast, though redux was a pretty nice fit other than that.
- rpeden 10y agoThat's a good question; I didn't try it. On the bright side, if you don't mind diving one layer below the surface, the code for react-router-redux is short, well written, and easy to understand: https://github.com/reactjs/react-router-redux https://github.com/reactjs/react-router-redux Even if the equivalent already exists for the current iteration, you could probably write your own in an afternoon without rushing yourself too much.
- tracker1 10y agoThat's kind of what I did... It was not in a modular fashion though as a lot of it was trying to discover how the lifecycle worked in Angular 2... basically, I wanted to be able to trigger an effective redirect from angular or via redux action or via a route/hash change, and have the redux always reflect the current route... there were some bits with how the change detection works in ng2 that I had to tap into, apparently this is one of the bits that changed since I last used it though. If I have to use ng2 again will take the time... aside, I really wish they'd renamed it to Angular 3 (3.0) for release, given the massive changes to "Angular 2" over its' lifetime and the number of broken blog articles and tutorials...
- lenkite 10y agoIf you want redux in angular 2, take a look at https://github.com/ngrx/store https://github.com/ngrx/store
- KukicAdnan 10y agoIt's not really a fair comparison. Angular 2 is an entire platform while React is a library for building UI components. You can also combine React with an Angular 2 app if you wanted to. The answer here is use the right tool for the job - both are great.
- smegel 10y ago> both are great. That's probably why people are so confused. They might not be an exact comparison, but you use them both for the same purpose, building responsive, data-driven websites. Or should we just use JQuery until the dust settles?
- ggregoire 10y agoI worked 2 years with Angular 1 and it was OK, but now that I'm working with React I can't imagine going back to Angular. You should read the official tutorial on the React website [1], it take like 1 hour and you will know everything about React (the API is incredible simple). Then start your app with the official Create-React-App [2] (it installs for you a webpack/babel configuration and a fetch polyfill, so you can use out-of-the-box JSX, classes, import/export, async/await, a cross browser fetch for your AJAX calls, etc..). You don't need Redux, but probably React-Router if your app has several pages. And that's it! The React/Babel/Webpack stack has completely changed how we develop web applications. And with Create-React-App you avoid all the boilerplate. [1] https://facebook.github.io/react/docs/tutorial.html https://facebook.github.io/react/docs/tutorial.html [2] https://github.com/facebookincubator/create-react-app https://github.com/facebookincubator/create-react-app
- billions 10y agoHaving recently evaluated both for a new project, today I would recommend starting with React simply for the maturity of React libraries. In 6 months this may be a different story.