DEV Community

Vugar for Angular

Posted on

The Famous Misconceptions in Angular

Alt Text

As Front End developer who worked in Forune 500 companies such as Raymond James financial advisory company and SwissRe leading insurance broker, in this blog we gonna discuss some famous misconceptions among non- Angular developers. This blog should be unbiased and focused on facts only.

Myth #1: Steep Learning Curve in Angular

Alt Text

One of the famous misleading opinions we observe among people especially on Twitter and youtube gurus is ‘Angular has a steep learning curve’. The short answer is yes, Angular has not a small road to learning and master. But let’s first analyze the definition of this concept. A steep learning curve refers to: ‘The amount of time required to learn is big’. Interesting but what makes it BIG? First, let’s point out Angular is a fully-featured framework. It has built-in Routing, powerful Forms, Dependency Injection and it is built-in Typescript. In addittion, when learning Angular you learn also software development principles and patterns which in other web frameworks not required. This knowledege is applied and transferred to other programming languages too(from PHP to .NET). You think Forms is simple to manage? Just try it please with compex projects. See this blog. Let’s compare it with a libary or framework which is easy to learn and does not have any of those bulilt in features. Now can we imagine building a real-life enterprise application without any of those features? Of course No. Unfortunately, the real web application is NOT the promised TODO app you see in bootcamps. It is more challenging and more interesting. Now for enterprise projects, besides UI rendering, calculate the amount of time to learn those missing 3rd party packages and sum it up with the time required to choose the best fit for the company. Now sum it up again with Typescript which is extremely famous and used in most enterprises regardless of which tool you use. We conclude that the learning curve is more or the same. Finally, we are going bust this myth with the below quote:

‘Easy to learn does NOT mean easy to build a real app’.

Alt Text

Myth #2:NPM Stats shows Angular is behind React or VueJs
Alt Text

Another popular opinion can be observed in blogs is that Angular is not popular because it is behind in npm stats.

Let’s first start with the definition of this concept before analysis:

NPM stats illustates the number of downloads of package in a given amount of time.

So you may wonder why the number of Angular downloads is not leading here. Well, let’s first remember that Angular is popular mostly in big and very big enterprise projects. In those big companies with thousands of developers, people do not simply install packages from NPM default registry. Instead, company infrastructure has its own virtual registry which has cache and custom security settings. This means the real number of downloads of package(in this case Angular) is NOT reflected in npm stats. We can confirm that by comparing the amount available of jobs in javascript front end world. It is May 9, 2021, 00:37 in Poland time while I am writing now. I am comparing stats of jobs via indeed.com worldwide. From the results we can observe that Angular has 18,929 jobs, React has 12,096 and Vuejs has 3,204 jobs. So it proves again those npm stats do not reflect the reality.

Alt Text

Myth #3: Angular is changing in every version.

Another interesting opinion we can observe, some developers who are not familiar with Angular think it is new framework on each new version with a lot of breaking changes. But it is far from reality. Angular is focused on incremental improvements and minimal breaking changes. Also, those breaking changes are mostly taken care by powerful ng update (thanks to angular/cli team).

Alt Text

For instance: recently, we have upgraded our project which was part of a leading insurance broker company from v10 to v11. So it took us less than an hour. There was a small routing-related breaking change and it was taken care of by ng update. The other example but much smaller project is my custom library. Roughly 1 hour was spent to upgrade from v6 to v10. There were minor breaking changes and it was migrated by ng update.

Update: Regarding RxJs is overkill reactions. Let's analyze
below screenshot with and without using RxJs.We see that on the top we use pure RxJs, on bottom without RxJs. On Bottom we declared 4 new variables for a simple thing. Each variable comes with maintenance cost especially in complex proejects. The worst part is, it is not even reusable. It is just a simple TODO task that we develop often.

Alt Text

Alt Text

Finally, we have reached the conclusion of the blog. This article was not about bullying Angular but rather focusing on myths and facts. I have worked with Angular, React, VueJs. All have their own advantages and have a bright future IMO. That’s all, hope you enjoy it. Also please do not hesitate to contact me by the article responses or my Twitter ! Cheers!

Top comments (19)

Collapse
 
dylanesque profile image
Michael Caveney

So, I don't agree with the learning curve at all: If you don't know RxJS or TypeScript beforehand, the time to get up to speed with those (especially RxJS) will significantly make it harder to learn Angular. Another thing that makes is a lot more difficult to learn is that there are multiple ways to do things (for example, pass data between components) without clear weigh-in on when you should favor, say, services versus Input/Output decoprators.

Collapse
 
vugar005 profile image
Vugar • Edited

Hi. Thanks for comment. This is one of the things I pointed there, even though projects not using Angular, they are using Typescript and it getting more popular. Even Vuejs switched to full Typescript. Many folks who were critizing Angular for using Typescript, they are now happily using Typescript with React or Vuejs. Regarding, RxJs yes, it has learning curve. But what is alternative of that? Promises, thunk, Redux saga? Unfortunately all comes with cost. RxJs takes time to learn and master but as a result the code is neat, easy to read and flexible which is crucial in long term projects. Please see newly added screenshots on post. In addition, you are not obliged to use RxJs, you can convert it to Promise any time with from operator but I haven't seen anyone to prefer promises by giving up RxJs powerful opeators.

Collapse
 
dylanesque profile image
Michael Caveney

You can write async code just fine without a complicated library like Redux Saga or RxJS. RxJS really shines when you have to combine or pick through data in a certain way, but it's total overkill as the base data-fetching paradigm for Angular.

Thread Thread
 
vugar005 profile image
Vugar

Well in that case don't use RxJs in case of feeling overkill. It is totally fine, but you never know, requirements are rapidly changing so you end up refactoring to RxJs or other libraries.

Thread Thread
 
shaijut profile image
Shaiju T • Edited

In some Angular tutorials, RxJs is used to make simple http call to API. Is the purpose RxJs is just to make Ajax call or there any particular use case to switch to RxJs?

By the way, Below RxJs video made it simple to understand.

youtube.com/watch?v=eUYigtm3Sdc

Thread Thread
 
vugar005 profile image
Vugar

I just updated the blog, with and without RxJs example. Thanks.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
vugar005 profile image
Vugar • Edited

Hi Michael, you can convert Angular HTTP to Promise . See getData method in stackblitz.com/edit/rxjs-vs-promis...
Also developers are not obliged to use http, you can use fetch or some techiques. Http just adds additional useful features.

Thread Thread
 
lyrod profile image
Lyrod

It is really good to use angular http api (rxjs observable) when you want the ability to cancel any request by unsubscribing the subscription

Thread Thread
 
dylanesque profile image
Michael Caveney

The async pipe IS extremely nice

Thread Thread
 
lyrod profile image
Lyrod

Indeed

Collapse
 
polyterative profile image
Vladyslav Yakovenko • Edited

I am really pleased to meet an article that does angular it's justice.
I partially agree with the learning curve discourse but it must be specified that the technologies necessary to use angular's full potential completely change the workflow positively.
Since I learned RxJS I stopped imperative programming completely because ReactiveX is just that good.
Angular is just that productive if you're serious about strong and maintainable code.
I love it 3000

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

IMHO the greatest benefit of RxJS is that it changes your way to look at data. Without RxJS you've got a "procedural" mindset: first do this, then wait for data, then do that. It's like fetching water in buckets - one by one. But RxJS teaches you that data flows between your components and you literally build pipes, a network of pipes, so that the data automatically reaches all the components it should. It's powerful, elegant, and I'm pretty sure it even makes apps more robust. But boy does it have a steep learning curve compared to async/await!

Collapse
 
kotov profile image
Georgi Kotov • Edited

Nice article... hard to come by those which are not bashing Angular...
Honestly I've started with Angular 2 as my first SPA framework and not sorry about it.
My first project was an online exam platform, which was used by ~50k people.

I would say the advantage that Angular gives you even as a beginner is that it provides structure and implicitly makes you think about it . I've done little with React but my impression is if you haven't done any prior coding it's easy to get it to a spaghetti level.

While the above statement is true with any programming language I think Angular does a good job to provide you with code segregation principles and having the scaffolding more organized to services, components, modules spec etc.

RxJS is just great at any level with great docs and even for a beginner it's easy to comprehend how to use it and how combine/mutate with multiple sources, streams etc.

Collapse
 
kuncevic profile image
Aliaksei Kuncevič • Edited

There are a lot of misconceptions about Angular in non-angular communities because some referring to Angular when really still thinking Angularjs (v1.x.x). You can also checkout frontendwatch.com for more details about Angular and other top front-end frameworks.

Collapse
 
shaijut profile image
Shaiju T • Edited

Nice 😄, I think Angular is used to build enterprise level and large apps so its easy to maintain the code base.

There is a saying : "Use right tool for the Job".

Which means Angular and React are not the right tools for every Job. Sometimes the right tool for your project can be Angular, React, Java, Node.Js, .NET etc...

Before 10 years it was PHP , Now Angular, React etc , Who knows what will be in future ?

Hope you understand the point. 😄

PS: Some interesting posts:

dev.to/rohitrana/why-react-is-winn...

dev.to/ben/which-javascript-framew...

dev.to/cadienvan/the-best-way-to-l...

Collapse
 
teja463 profile image
Brahma Teja Ponnuru • Edited

Really great detailed explanation. Yes most of the enterprise applications prefer Angular. But IMO... In React it is very clear and straightforward to pass data and functions to child components, dynamically rendering child components, to find out why a component is re rendered, how the state has changed etc. But in Angular I don't think it is that easy. I feel it takes less time forba react developer to go from a beginner to pro, buy in angular it might take more time.

Collapse
 
shriji profile image
Shriji

If you want to add complexity to your stack and make heavy applications use Angular.