4 ms·
Angular two lost me.
by zxcvcxz 11y ago
Angular two lost me.
- joshmanders 11y agoYeah I wasn't too thrilled with Angular 2.x either. I had always been watching React and liking it, but I had no experience with it. So one day I decided to give it a whirl and see how far I could get converting the Angular 1.5 app I had already started and get it to the equivalent state in React. Long story short, I took 40+ hours of Angular 1.5 code and converted it to React code in a single 8 hour work day without any prior experience in React. I was both impressed and giddy. The next day I merged that reactify branch into my develop branch, and continued on. I feel that React does components better. I feel that Angular 1.5's introduction of the component sugar over top directives and even components in Angular 2.x just felt shoehorned in as an afterthought. I couldn't even spend a day trying to figure out how to componantize this app in Angular 2.x let alone 1.5. Now I'm head deep in learning as much about the ecosystem as I can, Redux, Relay, GraphQL, all that good stuff. I've officially ditched Angular for the React ecosystem.
- Bahamut 11y agoSounds like that is credit to both Angular and React for facilitating largely library/framework agnostic code. I should mention that Angular 2 is quite a work in progress currently - even though it has the beta label, it still is very much far from production ready IMO. Components in Angular 2 are largely well conceived, excepting the interactions with inputs and outputs and how they interact between reusable components. React was cited by an Angular team member to me as being vastly easier to use when it comes to intercomponent communication currently - I trust the Angular team will eventually get it right, but for now there are certainly some holes.
- asimuvPR 11y agoCould you share more about the experience? I'm building a dashboard for a realtime web system and React seems to be a solid choice to keep things simple and tidy.
- cname 11y ago> I took 40+ hours of Angular 1.5 code and converted it to React code in a single 8 hour work day That doesn't seem like a fair comparison considering that when you first wrote that code, you probably had to figure out things unrelated to whatever framework you were using and didn't have to deal with that aspect when porting to React. For example, if I rewrote a Django app in Pyramid, it wouldn't take as long as writing the original app even with the overhead of learning Pyramid, because I've already figured out the functional aspects of the app. Generally speaking, learning frameworks isn't the hard part of writing an app, unless the app is trivial.
- true_religion 11y agoThat goes without saying.... I took it as a statement of "someone new to the framework, can quickly rewrite their old code" if they came from Angular. Which is an important metric. When I converted a Backbone app to Angular, it took 3x as long simply because of the amount of ceremony and process that I had to go through to do things the idiomatic Angular way. React on the other hand, as a view layer, is so dead simple that you can internalize its workings within hours of study. The complexity with React comes with everything else---Redux, React-Router, GraphQL, CSS in React, etc. None of that stuff is defined as part of the React framework itself, but that's the only way you can make a "fair comparison" to Angular which is a full-stack framework.
- stephenhuey 11y agoI recommend you look into Aurelia which was created by a member of the Angular team who believed Angular 2 was on the wrong track. Aurelia could serve as a replacement for Angular, and you can use it with React if you want to. Yesterday the Aurelia blog mentioned how their View Engine Pipeline can use React and Angular components all together in Aurelia: http://blog.durandal.io/2016/04/06/aurelia-on-net-rocks/ http://blog.durandal.io/2016/04/06/aurelia-on-net-rocks/
- bunkat 11y agoI went through a similar experience with our code base and saw similar results. Our project is quite a bit larger (some 20k loc) but converting it to React has been a huge win. Performance has improved without all the custom code needed in Angular, bugs are easier to find and fix, and reasoning about the code is a ton simpler. I hate to think about all the time we spent trying to optimize the Angular digest cycle... . We also discovered that since writing components is so much easier in React than with Angular 1.5 we tend to write a lot more of them. This makes the components easier to test and has greatly improved reuse across the code base. Which in turn makes adding features possible that would have destabilized the old code base. I did look at Angular 2 and just saw more of the same and didn't want to deal with it anymore. I found that I personally aligned well with the React ecosystem (Redux, JSX, CSS in Javascript) which probably colored some of my decision.
- dceddia 11y ago> I hate to think about all the time we spent trying to optimize the Angular digest cycle... Yep. I spent a few days last week reimplementing a heavy part of our app in React, specifically because of this problem. "Make everything a component" is a great idea, but does not work so well in real-life Angular 1.5 when you're building a complex tree-like editor. The digest cycles grow longer and longer. The code reimplemented in React is 30% smaller and 8x faster (with some other tweaks to cut down on the frequency of digest cycles). I'm really enjoying React so far.