days
-4
-2
hours
-1
-8
minutes
-5
-4
seconds
-3
-3
search
This should help you decide if Angular is the best choice for you

Angular — The good and the bad

Radoslav Karaivanov

© Shutterstock / Anatoli Styf

Stack Overflow recently analyzed the most dramatic technology increases and decreases and, naturally, we weren’t surprised to see that the Angular tag rules over the ‘most dramatic increase’ top. However, this doesn’t mean Angular is spotless — it has both benefits and disadvantages. Let’s dissect them.

Angular: The good

TypeScript

TypeScript is a superset of JavaScript, which means that if you know how to code in JavaScript, especially ECMAScript 6/7, the transition should be painless. Of course, the most significant difference is the addition of types, which brings static code analysis to the table and improves code readability and maintenance. That does not mean bugs will magically disappear from your project. You should still rely on established practices as TDD and code reviews but it does put you in a slightly more favorable position than pure JavaScript.

TypeScript also brings everything good that comes with newer versions of ECMAScript, including class syntax, arrow functions, async/await, etc. The addition of established OOP practices like interfaces, generics and method access modifiers smooths the transition of newcomers into the web ecosystem from languages like Java and C#.

While TypeScript can be verbose at times with inline type annotations, it is progressively getting better at type inference. It will probably never replace JavaScript and in some situations, it is mostly a hindrance to your development process (think small projects/libraries) but in the case of Agular, it is mostly positive.

SEE ALSO: What’s new in Angular 5?

Tooling

Angular is a framework rather than a library and as such offers a “complete solution” – both on the way “How Things Should Be Done™” and what you get out of the box in terms of coherent features. In comparison to libraries such as React and Vue, most of the major pieces are there – routing, HTTP client, animations, forms handling and validation, etc.

You can directly focus on the problem at hand rather than spend time analyzing and picking up libraries which cover these scenarios.

The build tools are adequate. It seems like Angular-CLI has established itself as the preferred way to start a new project in Angular these days. It gets the job done from development up to building and deployment.

Scalability

Angular is easy to scale thanks to its design and opinionated way of doing things. Designing your application around self-contained, testable, pluggable modules, lazy loading, a unified data flow and Redux-like state management will take you a long way before you encounter any scalability issues and spaghetti code. Following that architecture also enables bigger teams to easily work on different parts of the codebase without fear of breaking working code or stepping on each other’s toes.

Templates

Unlike React, which embraces the intermixing of UI templates and inline JavaScript logic, most of the time you can separate presentation from logic. One should think of Angular templates as an enhanced version of HTML with specific Angular idioms (*ngIf or *ngFor).

That does present a slight learning curve but the code is usually cleaner than the respective JSX Frankenstein hybrid of JavaScript APIs and markup, and in case you have designers on your team, they will be grateful.

SEE ALSO: 6 reasons why you need to try Angular

Angular: The bad

Simplicity and code bloat

Angular is not simple at all. There are a lot of moving parts, lots of concepts and conventions to grasp and the time investment is significant in order to produce something more than a To-Do application. The API is huge and potential breaking changes in future versions of Angular are a real possibility.

Even for someone with considerable experience in JavaScript/TypeScript, they need to invest time in what exactly is going on under the hood of the framework. Setup is magical, things happen somehow and the amount of concepts and boilerplate is significant.

This brings us to the other issue – code size. Angular is several times bigger than React and Vue, causing longer load times and performance issues mostly on mobile devices. The produced code is heavy and bloated. Even when utilizing Angular’s Ahead-of-Time compiler the resulting files are still larger than acceptable. Fortunately, the dev team acknowledges the problem and is actively trying to improve on it.

Documentation

While the documentation for Angular has improved over the past few months, I still find it lacking. A sizeable chunk of the exposed API is nothing but short stubs of methods and properties without useful description. I would also appreciate a changelog or another tool to easily compare what is new and what has changed between releases of Angular.

Author

Radoslav Karaivanov

Radoslav Karaivanov is a Senior Software Developer for Infragistics, where he works mitigate or eliminate the challenges, and to make the good parts of Angular even better, with the components he builds in Ignite UI for Angular. He is based in Sofia, Bulgaria.


Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of