Why I chose Angular πŸ”§

Juan Herrera
Jun 24 Β· 6 min read

TL;DR

I chose Angular because together we make a great team. It provides a fully-fledged platform that takes care of non-functional requirements such as compatibility, maintainability and testability while I focus on the user.

What problem does Angular solve? πŸ€”

Frontend development has become increasingly complex.

Ever since we acknowledged the potential of the web, our interfaces got richer and our features got more sophisticated, but as our requirements grew bigger, so did our challenges.

To give you an idea, these are some of the aspects I have to take into account when building a large enterprise app today:

  • A11Y ♿️: Making websites accessible for everybody including but not limited to color-blinded, vision-impaired, motor-impaired, or hearing-impaired people.
  • Cross-browser πŸ’»: Ensuring your website works seamlessly, or at least progressively, on almost every browser: Chrome, Safari, Edge, Internet Explorer, etc.
  • Adaptive πŸ–Ό: Providing a UI and UX that can adapt to all kinds of screen sizes (TV’s or small devices), resolutions (retina, 2x images), and types (phones, tablets, desktops), etc.
  • Multilingual πŸ‘„: Building websites that can adapt to different language structures such as RTL and LTF, plurals, currencies, etc.
  • Performance πŸƒβ€β™€οΈ: Creating websites that can be rendered under different network conditions such as 3G and on low-RAM devices in a timely fashion.

And this is just for the end-user β€” the developer has to deal with a lot of matters as well:

  • Maintainability πŸ‘©β€πŸ’»: Dealing with code bases that can easily reach millions of lines of code while ensuring proper developer ergonomics when it comes to modularity, scaffolding, and standards.
  • Building 🚜: Making sure your app bundles are lightweight so that you don’t surpass size budgets that would otherwise affect your performance and keeping an eye on any compilation errors and build times.
  • Testability πŸ§ͺ: Ensuring both unit tests and end-to-end tests run flawlessly, but also making sure creating new test cases remains straightforward despite the app’s complexity.

Note that for some applications, this is just an excerpt of the things you need, for some others, you can completely ignore these requirements.

For someone who is joining the software industry for the first time, this is just overwhelming.

As a professional, I'm responsible for understanding these challenges and knowing how to address them. Nevertheless, I don't want to spend hours figuring it out every time I create a new app. πŸ€·β€β™‚οΈ

That's my problem, and that's what Angular does best.

What does Angular do? πŸ€”

Angular does a lot of things, but maybe this picture can give you a better idea:

All those nice icons up there represent a set of tools Angular provides. Let's go through some of them:

  • πŸ’» CLI: According to large enterprises, the Angular CLI is one of the best features Angular is equipped with. It allows you to scaffold components, services and modules with just a simple command, but of course, that by itself isn’t very impressive. The real value of the CLI comes with heavier commands such as ng add @angular/pwa which automatically turn your app into a Progressive Web Application, or ng update @angular/core @angular/cli which automatically updates your app to the latest stable version of Angular. All of this is possible thanks to the power of Schematics.
  • 🚜 Schematics: You can think of Schematics as the Yeoman of Angular, but with superpowers. Schematics is a code generator, it allows you to create and transform code. For example, instead of creating your TypeScript models over and over again, you can create a schematic that generates the whole class for you with accessors and all. However, this is just a simple example β€” you might as well use it for complex logic such as refactoring a large application to use external templates instead of inline templates in all their components! Doing it by hand took me 2 hours, doing it with Schematics just a few minutes πŸ˜™.
  • πŸ–Ό Angular Material: It is a component library developed by Google that gives you access to a set of fully-tested components that work out of the box. It is initially themed with the Angular Material design system, but it also provides a CDK (Component Development Kit), giving you the opportunity to use whichever design system you need.
  • πŸ“ž Http Module: The Angular team knows that HTTP calls are present in most web applications. That's why Angular comes with a module that makes it easier for you. It is based on Observables so you can compose your calls in any way you like. Besides, it has HTTP interceptors which allow you to transform your incoming/outgoing requests with ease.
  • πŸ‘„ i18n: Angular also provides built-in functionality through the Angular CLI to help you create multilingual websites. It reads your templates and generates the XLIFF (or XMB) files that can be used for translations of texts, numbers, dates, and currencies. Once you have set up your translations, the CLI will create the corresponding builds for you without any additional effort.
  • πŸ§ͺ Karma, Jasmine, and Protractor: Unit tests and end-to-end tests are a priority for the Angular team. That's why Karma is already configured in every Angular project, created with the CLI. You can use Jasmine if you wish or switch to any other framework of your preference. In the end, all you have to worry about is writing your tests.
  • πŸ—Ί Router Module: Whether you are lazy-loading, pre-loading, or loading your routes on demand, the Angular CLI has a module ready to make it straightforward for you. It provides a maintainable structure that makes applications with heavy routing configuration easy to handle. You should only be concerned about the what while Angular cares about the how.
  • πŸ’₯ Reactive Forms Module: Forms is one of the most common artifacts in web applications. Some are rather simple such as login forms, others are complex where some field values depend on other fields values and such values need to be validated on real-time in both the client and the server… 😲. Well, the Reactive Forms Module helps you reduce the amount of boilerplate code you need to achieve this while allowing you to keep logic out of the template.

Of course, some of these features are far from perfect, but for now, they have saved me a lot of time.

Should I use Angular then? πŸ€”

Whether a tool is suitable or not depends on your current needs, circumstances, and challenges.

To me, Angular is very well suited for large challenges. Although, isn't the web a large challenge already? Ryan Grove provides an interesting point of view here:

If today we have better tools to help us do it well, then why not use them? A good reason would be the cost. For some people, mastering Angular can take significantly more time than learning other frameworks out there.

In the end, it's up to you to pay for it or not, but then, Henry Ford's quote comes in very handy:

If you need Angular but you don't learn it, you will realize you learned how to deal with every single problem Angular solves, but you still don't know Angular.


Thanks for reading! πŸŽ‰

If you have questions about Angular or are not completely sure whether if Angular is a good fit for you, reach out to me! I'd be more than happy to help you figure it out! πŸš€

Parkside

Parkside is a digital design & software engineering company. Routinely entrusted by market leaders of the future.

    Juan Herrera

    Written by

    Google Developer Expert in Web Technologies and Angular. Software Engineer at Parkside πŸš€

    Parkside

    Parkside

    Parkside is a digital design & software engineering company. Routinely entrusted by market leaders of the future.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium β€” and support writers while you’re at it. Just $5/month. Upgrade