DEV Community

Cover image for How Angular Works, and Why You Should Be Using It.

How Angular Works, and Why You Should Be Using It.

Chadwin Deysel on April 27, 2022

Angular. The JavaScript framework that strikes fear into the heart in many aspiring frontend developers. With a complex structure and steeper learn...
Collapse
 
leob profile image
leob

The elephant in the room is of course React - why use Angular when React is so totally dominant nowadays, in which scenarios is Angular a better choice?

Collapse
 
chadwinjdeysel profile image
Chadwin Deysel

Hi Leob. Thanks for mentioning React. Answering your question could be a separate post entirely (and there are many "Angular vs React" posts out there). To me however, the short answer comes down to personal preference and what you want to build.

In my opinion, while you can use React for larger scale applications, it's better suited for smaller applications or websites that needs to get the most out of SEO because of the GatsbyJS and NextJS libraries. Angular is just much better suited for larger scale applications because of the way it structures it's code and all the things it includes the moment you create a new application (routing, reactive forms, RxJS etc).

Collapse
 
frangiskos profile image
Frangiskos

Angular is a better choice for large-scale projects with many developers working on the same project. Not all developers have the same expertise or code in the same way. Angular is an opinionated framework that guides everyone to write in the same way.

Collapse
 
leob profile image
leob

Yep that's what I gathered ... on the other hand, if the devs on a project already know React (and not Angular) then the story obviously becomes different already - and you could argue that React has also become somewhat more "opinionated" over the years - everybody seems to have converged on using Hooks now, to name an example, and things like routing and so on have effectively become part of the "core" tool.

Thread Thread
 
edarioq profile image
Edgar Quintero • Edited

It's also a hiring question. React being so dominant (because it's simpler) makes building and keeping a team a lot easier. There is no question that Angular can run laps around React when it comes to software quality, utiliy, scalability, maintainability. But if it's easier to pick up, code with, and get something written faster, then companies will prefer it always... Never the engineers that know better. :)

Thread Thread
 
leob profile image
leob

That's what I also think, React has become so dominant, everything else (Vue, Angular) is pretty niche ... it also means that the React ecosystem is a lot bigger, and so on. Yeah well to be honest I think this race is over ...

Collapse
 
crisarji profile image
crisarji

Nice post!

What I hate the most of Angular is the exhausting boiler before even reach the declaration of your component!, prettier does a very good job arranging everything for you, but some times you have 50 lines before the Component decorator.

What I love the most, is the use of TypeScript; I have worked with Ng, Vue and React, and the use of TS is amazing!; classes, interfaces, enums, types, it is remarkable all the unblocked features present in Ng Framework.

Collapse
 
chadwinjdeysel profile image
Chadwin Deysel

Hi Crisarji, thanks for reading!

I admit, the boilerplate code can drive a person nuts at times, but using the Angular CLI effectively is a great way of side stepping this. One can run a simple command such as ng g component component-name and all the boiler plate for the code is taken care of. One thing that gets to me though is the crazy amounts of imports you end up with in a complex component.

Collapse
 
leob profile image
leob

Ng framework, what is that, is it an acronym for Angular? Of course React works just fine with Typescript as well (as does Vue) ...

Collapse
 
edarioq profile image
Edgar Quintero • Edited

No dedicated section for rxjs? But very good content ty!

Collapse
 
chadwinjdeysel profile image
Chadwin Deysel

Hi Edgar, thanks for reading! Now that I look at it, I should've mentioned RxJS, something to consider for my future content.