DEV Community

Discussion on: Explain Angular to Me

Collapse
 
bradtaniguchi profile image
Brad • Edited

Before I start I have to point out that Angular is version 2+ of the framework, where-as AngularJs is version 1 of the framework. They have similar ideas (modules, directives, services) but the underlying code and tooling is totally different. I've heard Vue is closer to AngularJS 1 in many regards, where-as Angular is its own thing in most cases.

I will only be talking about Angular, as AngularJS has been a legacy framework for a while now, and is now more or less in LTS.

Angular is a web application framework

Angular's goal isn't necessarily to build SPA apps, but applications using web technologies.

  1. Angular provides top of the line tooling, to the point you can use its tooling to build React and Nodejs applications using the same commands as you would to develop an Angular app. By default it uses webpack under the hood, but is flexible enough to use other build systems such as bazel (Google's builder for most projects). The tooling also supports mono-repo development and library sharing out of the box.

  2. Angular is built for scale of apps. Almost every major standout feature was added to support building large complex apps.

    • TypeScript scales better than normal JS
    • Dependency Injection system to better facilitate sharing code and testing
    • Reactive code (rxjs) provides more power to handle more complex use-cases.
    • The module system provides more context to the build system, thus providing stuff like lazy-loading support out of the box
    • built in or 1st party support for web-workers, service workers, and server-side rendering
    • the entire framework was re-written (from AngularJs) due to AngularJs' issues with scaling, a newer render engine has been written (ivy) and should help improve performance of apps in most cases (who knows when Ivy get's here tho, since its been in development for years haha)
  3. Angular's goal isn't really to focus on UI's, or even components. It's to build apps. This explains a lot of the verbosity for many use-cases that are solved with simpler syntax in the other two frameworks, but simply put taking the out of the box approach is usually better for larger projects, rather than rolling your own solution with VueJs or React.


Disadvantages of Angular

  1. Reactive Programming/rxjs is complex as hell
  2. The framework has a huge API surface
  3. It's more verbose than necessary for most simple use-cases, and is simply overkill most of the time
  4. Angular doesn't provide any out of the box opinionated state management solution. Its easy to build your own, but its not structured like the rest of the approaches that are already picked in the framework.

I'm an Angular developer and I personally like Angular's structured approach to building applications. Its very easy to run into a problem and find a solution already built into the framework. No need for external libs for important use-cases. (besides state management hehe) Angular's got your back, as long as you stick through learning all the core bells and whistles.

Edit I never noticed anything of the usual like "explain it to me like I'm five" when writing this reply. I personally don't think 5 year olds are a very good target audience for Angular so I wrote my reply for anyone interested in web development, with enough experience under their belt to be able to google-fu their way to understanding hehe. Sorry to any 5 year old reading this, but this post isn't for you. ;)

Collapse
 
antogarand profile image
Antony Garand

Regarding state management, NGRX is the de-facto library for redux-like state management on Angular: ngrx.io/

I particularly like the effects mechanism on ngrx, which is used to trigger side-effects in the store in a clean way!

Also, I'd like to point out that NestJS is a backend strongly inspired by the Angular architecture, and they go very well together!

Collapse
 
bradtaniguchi profile image
Brad

Oh man I totally forgot about mentioning which state management solutions are available and most popular, thanks for pointing it out! 😄

I also like NestJS for the same reasons I like Angular :D