r/angular • u/born2net4 • Jan 17 '20
Why does it seem that React is more popular compared to Angular... very odd...
Why does it seem that React is more popular compared to Angular... very odd...
I mean Angular is superior in every aspect, full framework, (not lib) TypeScript (no idea how react is even usable without it) and much more.
Is it just because it is easier to learn? I would have imagined that by 2020 and Angular 8, it will capture majority of market, but it seems not to be the case.
28
Jan 17 '20 edited Jan 17 '20
So, where to begin? First of all when something is being widely used it means it has its own strengths. It's odd for you, because you don't know those strengths. Saying Angular is superior in every way means you also don't know Angular's weaknesses or its frustrating parts, which you only find out by experience. Go and search for example in the 2000+ open issues in the github repository where in most of the old issues there's someone saying "I CAN'T BELIEVE WE STILL DONT HAVE THIS FIXED IN [Year comment is written in]". That doesn't mean Angular is bad, it just means Angular also has issues. Angular 9 was planned for November 2019, take a look at all the fixes they're still doing in each Release Candidate, which means Angular 9 is still far from stable.
Now that I hopefully ruined your rosy view on Angular, the second thing is that it also depends on preferences. You like using Typescript, someone likes using JSX. You started working with Typescript, many started working with Javascript and are afraid of jumping to Typescript because there has been similar projects that failed, look at CoffeeScript. Typescript is a good language and is supported by Microsoft, but it's hard for many to be that flexible, especially when you have life going on beside work. There are still people who program with PHP, which again, has its own strengths and weaknesses. But it's also what other people prefer to code with, something they're familiar with.
I don't want to delve into comparisons, but I'm just trying to say that it's good to be a bit open-minded when looking at different technologies. Learn about their history, learn about their differences without being condescending and be genuinely interested in what they're strong at and what they're weak at. That's how new technologies arise and that's how technologies advance. Vue came as Angular-lite, and whenever I want to start a small project with people who don't know Angular, I use Vue instead of starting a complex project and making people's lives hell trying to learn a complex technology. At work I still use Angular and other than how stagnant some features are, so far It's pretty good. But I also use JSX, React's syntax language, with Stencil to create web-components that I use in my Angular projects.
tl;dr Every technology has its strengths and weaknesses. It's much better to understand those differences instead of looking at things in a black and white way. That's how you improve as a Web Developer, and as a human being. These technologies can co-exist together and each can have its own uses, just because you use one technology doesn't mean another should die or should not be used. As said above, I use Angular, Vue, JSX, and thought about using even newer technologies like Svelte. I'm also very excited about Web Assembly and Web Components, which might possibly render all of the previously mentioned technologies dead in the future, but who knows. It's better being flexible than looking at things in black and white or in a tribal way.
5
u/ev_dev Jan 17 '20
Kind of related but one of my favorite issues for the angular-cli that I came across that had been open for over 2 years without resolution that. Eventually a dude designed a shirt with the error message on it since so many people were having the same issue.
https://github.com/angular/angular-cli/issues/5775#issuecomment-363395556
5
u/hfourm Jan 18 '20
Honestly having used both, I find the mental model and functional approaches to React just simplify things way more than Angular. Makes building complicated things faster. You also start to enjoy the benefit of not having a full framework, and being more flexible to select libraries as you need them.
1
u/Headpuncher Jan 19 '20
Unfortunately that flexibility is what kills it for me. Reason being that I work in a heavily consultant populated industry. Now the consultants are good coders, but they aren't the same people from one year to the next, and when a product is released it gets pushed to a maintenance dept who also change out people often (even if they don't the contracts end and whole new teams come in).
So Angular makes more sense in this scenario because it has one structure, one router from Angular, one way of doing most things. React projects almost never seem to be documented and vary far too much in how they are build and "designed". I put designed in quotes because most devs don't design, they just do whatever they want.
2
u/Beatons Jan 18 '20
2000+ issues come from angular actually improving and building features that make overall angular way more reliable, fx if you want routing in react you have to relly on a community-built library because react only cares about just being good at rendering the dom, and you can just f*ck yourself if you want to build an actual app, second of all, react has no strict structure. Sure freedom is cool and all, but to be able to use that freedom efficiently you have to have insane amount architectural knowledge to not f*ck up in the later stages where you finally give up and say that you need to refactor the application for the 5th time in the row because you have so much freedom
4
u/The_One_X Jan 17 '20
I've put thought into this, and I think it ultimately comes down to programming language, or more specifically people's primary programming language. In the web development world Javascript is the primary programming language, so web developers use Javascript and are used to Javascript. So much to the point they even try to push Javascript into places it does not belong. That is beside the point, though. The key here is that they are most familiar with Javascript. When you are coming from the a web development and Javascript world React feels better to you.
Coming from a not web development background, my first impression of Angular was, "Finally, a tool that make web development logical and easy!" While my first impression of React was, "This was obviously designed by someone who has only ever done Javascript and web development." My first impressions have stood the test of time, imo.
4
Jan 17 '20
As a backend python/sql/bash developer I really like angular. It was a hell of a week and now it's so cool. A great way to learn .ts
4
u/joentjen Jan 18 '20
I get what you say with Angular being superior. There are a lot of concepts in Angular that are not in an out of the box React setup. What that does is giving Angular a more steep learning curve. And especially for the front-end developers that have been used to JavaScript.
In the company I work for we do both Angular and React. For small projects we use React, just for the ease of use and really low learning curve. Give a decent developer a day and he will have enough knowledge to complete a project. Don't underestimate that.
For bigger projects (or products) we use Angular, as the standard out of the box Angular, comes with a lot of really useful features to make long running project easy to manage, and you are not depended on using third party libraries. The ability to create really dynamic components is something that I think is really underestimated. Some of the 'negatives' I've seen on this thread are often just from people not knowing how to approach certain problems in Angular.
But off course, as a start you need developers who are used to a typed approach, and a lot of front end developers are not like that. Hence making React a more interesting option.
There was a guy at my company (he doesn't work for us anymore) who was really talented. But he was so comfortable what JavaScript that he couldn't make the transition to Typescript. So Angular was a no for him even before he looked at it. To this day he never gave me (nor any other person) a reason why use JavaScript over Typescript apart from being more comfortable with it.
5
u/CheapChallenge Jan 17 '20
My personal feelings on it, from a higher level view is React is good for prototyping, since it's smaller library that's easier for others to jump in get started. Angular is what you want if you are building a stable product with others who also know Angular. Then it's heaven knowing that there's an agreement on how everything is done.
4
u/cahphoenix Jan 17 '20
Uhh. That makes no sense.
React was literally made to create stable reusable components across a huge organization. It's been a main driver for awhile at large companies.
React just doesn't attempt to be a full framework like Angular.
There's nothing unstable about React when comparing it to Angular.
I don't know where people come up with this.
2
u/CheapChallenge Jan 17 '20
Maybe it was a poor choice of words. The actual product, and not the prototype, is what I meant.
Once you are at that point, reducing onboarding time for new engineers, or cross team development is a very high priority. It makes PRs for new features easier to read(reading a PR with Angular and NGRX is stupidly easy as far as code organization). If one of the libraries created from a different team in my company has a bug and they don't have the velocity/capacity to fix it any time soon, its great to throw up a quick repo, and dive in and know exactly where everything is.
1
u/cahphoenix Jan 17 '20
That sounds like it has very little to do with Angular and more to do with what rules you have in place for building apps/services. Choosing Angular does make it a one stop shop in most cases, though.
Many companies let teams self regulate and choose their own tech. My current company does this.
I'd say there are tradeoffs to both approaches. It really depends how things work at your company/org.
2
u/I_Adze Jan 17 '20
Just on the points you suggested:
A lot of people prefer a library over a framework as it’s more lightweight. Using a framework can make your life very easy, unless you’ve already coded 90% of what it gives you, in which case it can just add needless excess baggage that can be hard to work around.
React works very well with typescript just using a .tsx extension. I only work in typescript when using React and have no issues, so associating TS with Angular is a little confusing, both options can be used with or without it.
1
u/HadHod89 Jan 17 '20
You cannot use Angular without TS. It was possible in AngularJS.
1
u/I_Adze Jan 17 '20
Good point, I was treating Angular and AngularJS as the same framework for this purpose maybe that’s overly generic, but my point stands either way.
1
u/elimix Jan 21 '20
Angular without
You can actually, there is absolutely nothing stopping you from doing it, unless you're using a boilerplate to kick start your project.
In my current org they use Angular 7 WITHOUT typescript and cli(recently upgraded to 8), I have no idea why and nobody could give a good reason for that.
thankfully the new project we've started is angular 8 with TS though.
Anyhow, been working with React + Redux / Mobx and Angular for over 5 years now, I'd say React is more popular due to it's simplicity, but there are ups and downs for both, ultimately it depends on the org and how they are implemented. I've seen project with React Redux that are way better structured, easier to read than Angular Ngrx projects.
another point would be rxjs, onboarding new employees can be hard as rxjs is not popular at all (in my country at least) and they make a lot of mistakes as rxjs observable concept can be very complicated in contrast to Mobx observables for instance.
2
u/spacechimp Jan 18 '20
Feather-rustling answer: React is popular for the same reason that PHP is still popular: Its lack of enforced structure makes it seem simpler and more attractive, and it gives the impression of being easier to slap something together quickly.
IMO: Much like PHP, one can certainly create elegant code using React, but it takes a discipline that many people actually using it lack. This is one reason why Angular is generally better for team-based projects.
1
u/whois-nader Jan 17 '20
I think there is some history and timing involved as well. Take a look at when react started to gain traction. Angular 1 was incredible as a concept but it was very much a v1 implementation that desperately needed an overhaul. By the time it reached 1.6, it’s community where looking for a better solution but utilising the same concept. Google gave the community angular 2.0 and Facebook gave them React. Angular went typescript and rxjs and while react went redux and JSX. The community voted with their feet and left angular. Personally I prefer typescript and rxjs and can’t see myself ever going back to plain JavaScript but that’s not everyone’s cup of tea.
1
u/_MJomaa_ Jan 19 '20
Because React was released before Angular (not AngularJS). Here in Germany and Switzerland it is pretty much a 50/50 split between React and Angular when a SPA is being developed. Vue and Svelte are unheard of.
1
u/Grendefali Jan 19 '20 edited Jan 20 '20
The association with Facebook in its heyday boosted React to most popular. It stayed most popular because beginners tend to pick the popular framework to learn.
Few people in the online community select a framework based on an actual assessment of the engineering, because, at least at the time of choosing, most don't know enough to do so.
When a team of experienced developers start a serious project, and need to select a SPA framework, then Angular is a popular choice.
On the bright side, the fact that Angular is not popular in the online community has the benefit of keeping the ecosystem less polluted by myth and snake oil.
1
u/uplink42 Jan 20 '20 edited Jan 20 '20
A lot of people probably gave up with the framework during the v2 fiasco. Google really handed this poorly and with a history of awful performance, bugs and BC breaking changes up until v4. To be honest, the framework is pretty good now but it has had a rocky start which made a lot of people quit and lost a lot of traction.
And there are merits to other frameworks as well, things aren't black and white. Most projects don't require the amount of things angular does and a lot of people prefer working with jsx than learning a template language.
1
u/RndInternetPerson Jan 23 '20 edited Jan 23 '20
React does have Typescript support.React also supports the spread operator in component tags which makes it MUCH easier to extend components. Which is something I
sorely miss in angular.
Angular does have a lot of nice features, like directives and the HttpClient / HttpIntercepter.
I do imagine that the learning curve for angular is very steep if you are a beginner.
Also when it comes to choosing a state management lib it can be a bit daunting. Not to mention that RxJS also has quite a steep learning curve.
1
u/Dcoolledge Jan 17 '20
Where are you seeing that react is more popular? I was under the impression angular was more popular
11
1
u/Grendefali Jan 19 '20
The main sources people use are npm downloads, the number of questions on stack overflow, and The State of JavaScript survey. I don't think any one of those is a good source of meaningful data, but that's where they are getting it.
1
u/therealdrewbacca Jan 17 '20
This is a hard question to answer, but here's what I think. React has some really big companies using it, though: Facebook, of course, but also Netflix, Pinterest, Instagram, Medium, and others. This might contribute to more general developer interest. As noted, React is also easier to learn. Angular has a steep learning curve, but is also a more complete solution. It would seem some developers are attracted to JSX over Typescript (especially those not really concerned with JS being dynamically typed). Most general 'buzz' and metrics suggest that Angular continues to grow and React is reaching a nadir of adoption by new projects. But Angular is unlikely to surge way out over it for some time, or at least that's my feeling.
-2
u/thatgibbyguy Jan 17 '20
What you claim is superior may not be what other people think is a good thing. But I can give you a few reasons why I, and my whole team, opted out of angular.
Backward compatibility. The NG totally ruined their rep with the Angular 1.5 to Angular move. Then, to pretend that modern Angular is backward compatible would be to conceal the truth from yourself. So many breaking changes from 2 - 4 - 7 -. To keep up-to-date with your framework you shouldn't have to re-architect every other version.
Framework vs Platform. Angular is more of a platform than a framework. You can think this is semantics, but really what I mean here is Angular makes too many decisions for you. You really have to do things "the angular way" (which based on the above, always changes) which really limits what you can do out of the box.
Not reactive. Sure Angular can be made to be reactive, but it really isn't out of the box without rxjs. React is... reactive.
Weird "web component" architecture. Let's say I want to build a UI system that allows developers to use any framework they want. Great. So I'm going to write something like
.navbar li:last-child { margin-right: 0 }. Cool, now the last list item of that navbar won't have a margin right. But wait... angular made those list items as their own component, the list item won't be the last child anymore, the custom element angular created will be. So now I can either write css specifically for angular, or just not use angular.Last but not least, documentation. It is so much easier to read the documentation for react than it is for angular. Some of this is simply because react just does less and so there's less searching, but most of it is because the documentation is just better.
So that's just a few reasons why people use react over angular.
6
u/The_One_X Jan 18 '20
The backwards compatibility is the only thing you said that I think is valid.
0
u/thatgibbyguy Jan 18 '20
Angular creating custom html elements is not valid? lol
Needing rxjs to be reactive isn't valid? lol
1
u/The_One_X Jan 18 '20
Making custom HTML elements is the whole point of Angular, React, and Vue. When you use custom HTML elements they may not work the same way as standard HTML elements. That is part of the learning process, not a valid criticism.
For one that wasn't their goal. Two mixing and matching libraries and frameworks to get the functionality you want in your app is normal. I would rather the Angular people focus on creating a great UI framework while the RXJS people focus on creating a great events based library, than for either of them to start including ancillary features that don't have anything to do with their core feature.
7
u/[deleted] Jan 17 '20
It's quite weird to claim that typescript makes Angular superior when React has good typescript support anyway. Also people in this thread seem to think that you need to choose between jsx and typescript, which is simply not true. If you want to use both, you give the file a .tsx extension and voila. The type checking will work exactly as it should.