r/angularjs • u/Urigold • May 11 '16
Every “Angular 2 vs. React” article out there
https://medium.com/@urigo/every-angular-2-vs-react-article-out-there-cfd4f557be9b#.9v1mtehak9
16
u/wagedomain May 11 '16
I haven't looked at React in a while, is it still one of those frameworks where you need like two dozen other plugins to get what you get out of the box with angular?
11
u/ProdigySorcerer May 11 '16
Yes
10
u/wagedomain May 11 '16
Having lived in angular for years, that bugged me when I tried to switch out of angular. I felt like I was in dependency hell and had to research so many things. Angular has spoiled me.
7
u/akujinhikari May 11 '16
Only been in web dev for 9 months. Every project I've worked on has been Angular. These are HUGE projects. It's extremely difficult to remember how to do anything other than Angular now. People ask me javascript questions, and I'm like, "Uhhhh.... ng-repeat?"
8
u/wagedomain May 11 '16
That's normal. Before Angular (and for many non-angular devs) ask them how to get an element by ID in javascript and they will answer $('#id'); instead of document.getElementById('id');
1
u/ikeif May 12 '16
So… angular is the new jQuery? People just using the frameworks/what-have-you without any understanding behind it?
3
u/wagedomain May 12 '16
It's another jQuery, yeah. I would guess most libraries/frameworks are the same way. At this point we might as well rebrand them to "Javascript Alternatives".
3
u/has_all_the_fun May 11 '16
Guess the article is true since I prefer configuring all the layers myself.
6
u/wagedomain May 11 '16
I thought I would. Switched to backbone a year or so ago and it was exciting learning all the new technology. The company chose backbone over angular because they "had more control" which made sense at the time.
Then they spent weeks to months of time building modules and crap that mimicked exactly the features angular had out of the box. So all that "control" bought us was wasted time and a sense of self-satisfaction I guess.
3
u/has_all_the_fun May 11 '16
Making the leap between Angular and Backbone is pretty big though. I would probably say React.js sits somewhere between that. What frustrated me with Angular was that it tried to force things on me I didn't want. Also the performance for my app was pretty bad using Angular and then the thing I had to do to fix to performance issues were even worse.
3
u/wagedomain May 11 '16
What frustrated me with Angular was that it tried to force things on me I didn't want.
What are some examples of this out of curiosity? I found that moving to backbone I lost a lot of things that make life so much easier, like directives.
3
u/has_all_the_fun May 11 '16
It's been a while but I remember the module system, the amount of concepts (services, factories, controllers, directives ...). Directives having this weird configuration where you had to tell what type it was and they also have state. I also switch to UI router which was recommended back then which also introduced state. Keep in mind that this was 2.5 years ago so maybe things got better.
Something that I discovered later with React was also that having templates in different files make components less portable. Although in React you don't really have templates but it's more view instructions so maybe it's apples and oranges
Something positive I did notice about Angular a while back was that there was also interest from the community and core in using the Redux architecture. Although I think it was only Angular 2. Having one architecture dealing with business logic in both Angular and React would be really be sweet since then you can use/change whatever view layer you prefer.
2
u/wagedomain May 11 '16
Some of this stuff is addressed in Angular2. Yeah, there's a bunch of weird boilerplate for directives, but their replacement, components, remove most of that.
The amount of concepts aren't really that much either, not if you break it down. And again, all that ends up happening a lot of time is people then build systems like Angular Services but it's a homegrown solution that now needs to be maintained and only that one dude in the office really understands it and then he quits and what the fuck do we do now???
The portability thing is interesting, but keep in mind for small templates you can in-line them inside the directive config. For anything larger, personally I'd rather separate it out anyway, otherwise you end up with 200-300 line files. Plus it keeps the separation of concerns nice and clean.
1
May 12 '16 edited Oct 02 '16
[deleted]
1
u/has_all_the_fun May 13 '16
It helps if you read the previous comments to know the context of what I was talking about. I am talking in terms of abstractions and the amount of batteries that are included which each tech.
0
u/namesandfaces May 12 '16
React, state management, routing, and some async solution, and you have the minimum number of pieces for your single page app.
I would also say that React is not a framework. A framework is a prescription of app architecture baked into a set of libraries. React is a DOM manipulation library, and how you want to structure your app is up to you.
0
May 11 '16
[deleted]
7
u/wagedomain May 11 '16
So you're saying, as the article says, it's an apples and oranges comparison?
0
May 11 '16
[deleted]
1
u/ikeif May 12 '16
Maybe mix it in with a "dev hiring is broken, here's my anecdotal, but true everywhere" experience?
1
u/ponchoboy May 11 '16
I found the testing of React components to be much more "duct tape it all together" than Angular. Seemed like I was npm installing 10 different test helper libraries.
2
u/iRedditWhilePooping May 11 '16
I've been working with angular for about a year now and for the fifth time in trying to force myself to write unit tests. I feel like it's so hacked together and I spend 5x as much time on just getting basic injection and debugging other services and weird interaction than writing and testing my code
0
May 12 '16
[deleted]
1
u/ikeif May 12 '16
You want to know the problem? Because people learned the framework/library and not JavaScript. They learned the cheats and the easy ways to do things, and never bothered to understand the "how/why" - so they just jump on shiny new thing to shiny new thing.
1
u/Conradfr May 13 '16
Maybe it was flawed, it certainly was over-engineered around factories, services, directives ... but it allowed me to work on small to large apps for years, that I can still look at and find maintainable. And it's still there, still supported.
I like React, redux etc (still trying to grasp Webpack though) but I'm glad I invested some time learning Angular almost four years ago.
3
May 12 '16
Missed the giant popup: "DID YOU LIKE THIS? SIGN UP TO GET NOTIFIED OF MORE ARTICLES LIKE THIS IN MY NEWSLETTER!"
2
2
u/LuisXGonzalez May 11 '16
Uri's Angular-Meteor project is pretty good. https://www.angular-meteor.com/manifesto
2
1
1
u/ravinglunatic May 13 '16
I stopped reading web dev blogs because they all sound like this. Now they all satirize like this and I can't even read the joke sites without getting irritated.
1
May 11 '16
React wins. The end.
-1
u/jax024 May 11 '16
Honestly, I think you're right. Angular 2 is great, I've used it on many projects. But React feels like the way I've always envisioned web development should be. The amount of boilerplate vs developer freedom is fantastic. I truly feel like I can tackle any front-end problem with a solid React + Webpack environment.
9
u/DOG-ZILLA May 11 '16
Angular 2 on many projects? Dude, it barely has a release candidate yet.
-1
u/jax024 May 11 '16
They were freelance prototypes. I was encouraged to use experimental libraries and frameworks.
3
May 11 '16
Who contracted a freelance prototype? I'm legitimately interested. Seems like if you want to fart around with experimental frameworks you wouldn't pay a freelancer to do it
1
u/jax024 May 12 '16
It was for this medical tech startup in my city. At the time I wasn't offered a real position yet it was of a "pay as you go" situation where I didn't even have to be there or anything. Good news is after that they decided to hire me so I'm pretty stoked!
1
u/DOG-ZILLA May 11 '16
404 - what's with this? Every Medium article on the Reddit app for iOS is broken.
26
u/Bitruder May 11 '16 edited May 11 '16
Sorry, I'd never use Angular or React because then I'm stuck with that framework and changing will be very hard down the road.
EDIT: Sorry guys, I was trying to play along with the article. Nevermind.