8 ms·
Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it? As I feel that
by cies 10y ago
Could someone tell me one-or-more reasons to choose Angular for a new project, now that the React ecosystem is mature enough to compete with it?
As I feel that from a conceptual/architectural point of view Angular is simply on a loosing path.
https://www.google.com/trends/explore#q=angular%20tutorial%2C%20react%20tutorial https://www.google.com/trends/explore#q=angular%20tutorial%2...
- laurencei 10y agoIf you run that some trends report - but with "Angular 2" - that shows a much higher uptake: https://www.google.com/trends/explore#q=angular%20tutorial%2C%20react%20tutorial%2C%20angular%202%20tutorial&cmpt=q&tz=Etc%2FGMT-1 https://www.google.com/trends/explore#q=angular%20tutorial%2...
- Secretmapper 10y agoThe takeaway of course is that most of those probably want to pick up Angular 2 because they used Angular. I made a conscious switch from Angular to React because React (and the flux pattern) really did reinvent how web components are built and it's incredibly intuitive. I simply don't see the same innovation in Angular 2 apart from 'we made Angular more modern'
- travmatt 10y agoI'm learning front end dev for the first time, and I chose React - it didn't make sense to learn angular when react borrows so much from html that I can apply some concepts more directly.
- dev360 10y agoHere is the same for CA: https://www.google.com/trends/explore#cmpt=q&geo=US-CA&q=angular+tutorial,+react+tutorial,+angular+2+tutorial https://www.google.com/trends/explore#cmpt=q&geo=US-CA&q=ang...
- david_p 10y agoIt's more mature now that the Angular 1 experiment is over It's written in TypeScript, so you can write your frontend in TypeScript. Many bugs averted. You can use a real reactive model (http://victorsavkin.com/post/137821436516/managing-state-in-angular-2-applications http://victorsavkin.com/post/137821436516/managing-state-in-...)
- chvid 10y agoMy impression is that a lot of "mature" (aka boring old) companies like Angular 1 and the sound of Angular 2 over React. For a number of reasons: - In general Java and C# programmers like it. - It is made by Google (perceived as more "mature", business like) rather than Facebook (young kids). - It takes a lot of inspiration from server side development with its dependency injection and general terminology. - And TypeScript is very similar to Java and C#. (The list is a slight caricature but I hope the general point is clear.)
- fchopin 10y ago> My impression is that a lot of "mature" (aka boring old) companies like Angular 1 and the sound of Angular 2 over React. React has been around for a while, but it is still only a library. Angular 1 and 2 are frameworks. Also Angular 2 is a complete rewrite and not even in final release. I'm not sure how that is boring or old. As with Angular 1, Angular 2 aims to be opinionated, so it should be clearer how to do things than with React. Especially now with the move to components, Angular should be easier do more with, without as much confusion. And Angular 2 is much faster, if you do it right, which was one of the reasons Angular 1 was left for React. React is fine for what it is. It's somewhat "matured" for a few years and is not a bad decision if you go with it. I don't think that you should just jump on the latest JS bandwagon, but Angular 2 is more than just "for mature companies" and "similar to Java and C#". Really, the only frustration we've had with Angular 2 so far has been that it has been changing so quickly, but it's starting to settle down now.
- chvid 10y agoThe places I am referring to are not actually using Angular 2. They are using Angular 1 but like "the sound" of Angular 2. Where the sound is the promise of a better tomorrow without actually looking at alternatives.
- bubtksins 10y ago> React has been around for a while, but it is still only a library. Angular 1 and 2 are frameworks. What does this even mean. Angular is also 'only a library'. > As with Angular 1, Angular 2 aims to be opinionated, so it should be clearer how to do things than with React. 'Should' and 'is' are different things, angular 1 was a complete mess. React is quite clean and straightforward. > Especially now with the move to components, Angular should be easier do more with, without as much confusion. Why? You don't give a reason of why this would be easier than with React. > And Angular 2 is much faster, if you do it right, which was one of the reasons Angular 1 was left for React. We are comparing Angular 2 with React not sure how 'Angular 2 might be better than Angular 1' is an argument against React. > React is fine for what it is. It's somewhat "matured" for a few years and is not a bad decision if you go with it. It's a much better decision than Angular 1 or Angular 2.
- spdy 10y agoThe only decision you have to make if you like opinionated frameworks or not. Both ecosystems are vibrant enough to stay for the foreseeable future.
- laurencei 10y agoOne specific reason I am personally choosing Angular 2, is that the Ionic2 Framework also uses Angular 2 [0]. So I can re-use code from my front end website on my native mobile apps for the new startup I'm launching. Much less code = quicker time to MVP, and lower cost of development. [0] http://blog.ionic.io/angular-2-ionic/ http://blog.ionic.io/angular-2-ionic/
- petetnt 10y agoHave you tried React with React Native[0]? [0] https://facebook.github.io/react-native/ https://facebook.github.io/react-native/
- Secretmapper 10y agoBTW to parent, one big advantage of react-native over ionic is that it's not a wrapped web app, but a javascript/react app that compiles to an actual native app. The performance difference and development experience (no silly css hacks) is very noticeable.
- nbclark 10y agoNot to nitpick, but I don't believe react native "compiles" to a native app. The evaluation of the JS in JavaScript Core is passed of to native code to layout native views. The interactions are then posted back into jscore. So while closer to native compiled code performance, it's still a bit different.
- Secretmapper 10y agoFair enough, I'm afraid I didn't explain it properly
- madeofpalk 10y agoIn my experience code-share between React and React Native is extremely difficult as your UI code is so significantly different with native components and what not. At least with Angular/Ionic you can directly share UI code between the two as its all HTML and CSS. Still, I really enjoy working with React and React Native because I it's one API and mental model to learn.
- ionwake 10y agohttps://www.google.com/trends/explore#q=react.js%2C%20angular.js https://www.google.com/trends/explore#q=react.js%2C%20angula...
- david_p 10y agoActually this seem to depend a lot on the exact search term, look: https://www.google.com/trends/explore#q=%2Fm%2F012l1vxv%2C%20%2Fm%2F0j45p7w&cmpt=q&tz=Etc%2FGMT-2 https://www.google.com/trends/explore#q=%2Fm%2F012l1vxv%2C%2...
- sakopov 10y agoI'm not sure I'm on the bandwagon that believes that commingling JS, CSS and HTML into a single "component" is a great thing. I just don't understand...
- scarlac 10y agoThere's a lot to be said for separating concerns and it's still good practice within your component. No-one is really disputing it afaik, but the way we are/were creating web pages are based on a document-centric paradigm. Single Page Apps (SPAs) are more app-like than webpage-like and if you're really going for reusability then your components need to have a say in how they are rendered. That means they need to provide /some/ HTML. You can still create components without including CSS but you'll likely need to provide structure (HTML) in order to bind behavior/callbacks/events to it. It's still good practice to separate rendering (HTML/JSX/NG) and behavior.
- EugeneOZ 10y agoYour link proves controversial point :) Please stop wars "a vs r" - it's counterproductive. Knowledge sharing is much better. If you don't trust me - read Twitter of Dan Abramov.
- _RPM 10y agoI'm honestly not sure why React being more mature now would be a reason not to use Angular for a new project.
- Bahamut 10y agoFor Angular 1 vs. React, I would just say depending on the resources you have - for example if a team is very productive with Angular 1 & there isn't enough time to get a team to pivot skills, then it may make more sense to go with that from a business perspective. IMO there is one main reason to choose Angular 2 over React currently - perf. Angular 2 has significant perf improvements over the other libraries/frameworks out there, and supports incremental rendering as opposed to React's render all at once model. Angular 2 also will have the best built-in animation support of the various libraries/frameworks out there, in part due to the Angular team's collaboration with the Chrome team (this is true with Angular 1 as well). Otherwise, React is more mature than Angular 2 & has a simpler API. Conceptually, Angular 2 and React share much in common, and architectures should look similar between well written apps in both.
- bradleyprice 10y agoWhat's the difference between Angular 2 and Reacts rendering? I was under the assumption that Angular 2 had implemented a shadow dom or something similar. Not arguing that you are wrong, I just haven't kept up with any of Angular 2 and am genuinely curios.
- Bahamut 10y agoBoth Angular and React rely on an AST - React uses jsdom, while Angular has a template compiler which constructs an AST from the template, and the renderer then can render from the AST as it determines. Angular can render templates with the inert template tag - this allows it to leverage browser caching for browsers supporting the template tag. It also supports the shadow DOM through its style engine with the component decorator. One can either use native shadow DOM (and use a polyfill for the functionality), or use Angular 2's built-in virtual shadow DOM where it randomly generates unique attributes to style off of with the component decorator.
- 0xfaded 10y agoI'm trying to find more info on angular 2 incremental rendering that you've mentioned. I've despised angular since pre-1.0, mainly for performance reasons. Once the number of watchers hits 1000 or so, a browser will noticeably lag. A compete rerender will cause a noticeable freeze up. I'm not currently using react either, but it's possible to do an incremental render through code, only rendering what needs rendering. React-dom will be needed to plug the result in the right spot.
- rtpg 10y agoI've found it more straightforward to transition to Angular over from a more server-side setup gradually. The template language is at least in the same general area as template languages for Django, Rails, etc. The general tooling process is pretty simple, no need to convince people of the merits of JSX. Architecturally speaking many people still like separating presentation from business logic. Angular has a lot of mature tooling and wrappings around current libraries. Angular also offers a lot more tooling on the side, React is much smaller. On an architectural side, while React keeps states in components, the state update mechanism is a bit obtuse compared to Angular's "scopes are just objects" philosophy. It's dependent on how you view things, but if you're working on things where strict component decomposition is hard, and you "like global state in your views", then Angular's state mechanism (controllers) could work better for you. Some would also declare that the non-turing-complete-ness of the template language in Angular is a feature, not a bug.
- cies 10y agoThanks for this!
- woah 10y agoYou separate your presentation from your business logic in React. What React gives you that Angular doesn't is the ability to separate your presentational logic from your business logic. Angular makes you put presentational logic in with your business logic because presentational logic simply cannot be expressed with the templating format. I would argue that a distinction that you make yourself, based on your application's architecture is more meaningful and useful than one made by some arbitrary separation of source file formats.
- RodericDay 10y agoAll the React stuff is starting to sound a bit to me like "MongoDB is web-scale"
- dev360 10y agoNot really. I think a key distinction is summed up in this quote: "Angular 2 continues to put “JS” into HTML. React puts “HTML” into JS." See: https://medium.freecodecamp.com/angular-2-versus-react-there-will-be-blood-66595faafd51#.1kuf8qlpd https://medium.freecodecamp.com/angular-2-versus-react-there... This influences to some extent what you can do with the frameworks and how your code is organized. I like the fact that since my rendering is essentially JS in React, then I can structure my code better with OO to solve problems (inheritance where appropriate, helper classes, patterns etc). In Angular, its just a awful mess of ng-* statements for flow of control. All you can really do to tame it is to use composition or to mix-in behavior via directives.
- ta_donk_gt 10y agoEssentially it boils down to whether you prefer a cohesive all-in-one framework/platform (angular2) or a collection of semi- and fully-independent libraries (react). Pretending that one of those options is the right fit for everyone is not productive. The only thing really missing from Angular 2 compared to the React ecosystem is jsx. Angular 2 and RxJS (and if you want throw in ngrx/store) allows a heavy focus on immutability, unidirectional data flow, centralized state, etc. that ends up very similar to the React ecosystem conceptually. Both allow native cross-platform mobile with React Native (react) and NativeScript (angular2), and Angular 2 also gives you a nice hybrid/webview option with Ionic 2. Angular 2 also gives you a bit tighter integration with TypeScript, if that is your preference (which it is mine). Personally, for me, I like both a lot but the full-framework and tight TypeScript integration fit my use cases and personality better.
- rubber_duck 10y agoI don't think JSX fits Angular 2 - it sticks to "views are markup based and code is in controller" traditional MVC which I prefer to JSX. You mentioned TS but I feel like you understated it - it's the selling point for me. I have used TS + React but it's not the same thing - Angular was written with/for TS and it uses it to leverage all the advantages. React migrated from ES5 to incrementally add ES6 support and it shows. Also nobody uses flow outside of React unlike TS which has a decent community even outside of Angular and plenty of 3rd party type definitions.
- ta_donk_gt 10y agoDefinitely agree about the deep TypeScript integration with Angular 2 due to it being written in TypeScript. That is the core reason I prefer it, it is absolutely awesome in that regard. (And the same is true with RxJS).
- lloyd-christmas 10y ago> TS which has a decent community even outside of Angular We've converted all our node backends to typescript. It's been a game-changer in productivity.
- 10y ago
- SonicSoul 10y agoThis might have been mentioned already, but I do like that they're not reinventing the wheel with ng2 on every front and instead leveraging libraries that are either mature or likely to be the direction that web is heading. If you follow their quick start example you'll get Typescript, RxJS, SystemJS. RxJS is a very interesting beast that has been around for a long time in c# world and recently gained popularity in Javascript and implements what may be a precursor to browsers Observable() object and anything-as-a-stream management. Not sure how React is solving these problems but probably a good idea just to go through a few simple examples to see how they work.
- Murkin 10y agoThe only reason - if you want to bet the future of your project on an untested framework, that seen no real world use and is still changing during its RC. Or simply put. If they named "Angular 2" by its real name "Some other cool framework name" - you would not use it. (e.g. Polymer 2)
- ken47 10y agoI love the direct integration of async support in templates. You can extract the value of promises and observable directly in templates using the async pipe, which cuts down on a lot of boilerplate. That means your templates can directly subscribe to observables and auto update on changes. Awesome. And there is first class support for component-scoped css, aka emulated shadow dom, which is great for large codebases.