All About AngularJS: Pros and Cons of Google’s Web-App framework

All About AngularJS: Pros and Cons of Google’s Web-App framework

AngularJS calls itself a Superheroic JavaScript MVW Framework.

Don’t scoff with derision.

With over 300,000 websites using this tool (at the time of writing), a rapidly growing community that just loves to give, and the unique way it rolls (it’s full of cocky self-assurance with lines like “teaches your browser a new syntax” or “this is what HTML should be”) one has to wonder if it’s really worth the hype. I mean, jQuery works, right?

AngularJS

Contentment is the enemy of development: quite literally for us developers. Angular sounds self-confident because it has every right to be. But don’t take my lone word for it. Check out what makes Angular awesome and awful and see if you agree with me.

Here goes:

The Pros:

Angular is extremely efficient when it comes to:

  1. Automatic DOM Manipulation

Updating model from view and updating view from model is no longer your (read: developer’s) responsibility. With two-way data binding, DOM manipulation is automated and you need not fret.

2. Trials and testing

This is what I adore about Angular: The rigorous refactoring and debugging. Dependency injections replace main() and the unpardonable mess it made (think maintenance issues). Testing is not just made easy but encouraged with unit-testing tool (Karma) and end-to-end testing tool (Protractor).

3. The Separation of Concerns

Logic is comprehension, and MVVW design paradigm has a comprehensible logic that’s great to work with. Simply put, the $scope (here: viewmodel) references the data, controller decides (or ‘controls’) its behavior, and your front end skills take care of the view.

4. Leaner, friendlier SPA Development

We know Angular and AJAX are best of chums and work amazingly well together for SPA (Single Page Application) development. But it goes way beyond AJAX with Angular.

It has built-in ngRoute module [note: requires angular-route.js to work] that makes deep linking (lets your users bookmark and save a SPA for later viewing) simpler. It lets you declare inline validation rules without having to write JavaScript. If that isn’t awesome, I really don’t know what could possibly be.

5. The Filters

This is one irrefutable plus, especially for developers working on content management systems who would rather bite their toenails than spend time writing client-side JavaScript.

For instance, using the legendary WordPress API, I can get JSON files of my data (read: posts, users, taxonomies, etc.) on an established WordPress site which needs a thorough, but speedy, revamp. I can then give it the makeover it needs with Angular, if I know what I’m doing.

Which actually brings us to…

The Cons:

1. The Learning Curve

This is at the core of every single pros/cons list-icle on AngularJS, and I may get some flak for this since I used to find it difficult too, but it looks more intimidating than it actually is.

All the syntax you and the browser have to learn in order to work with Angular is enough to make someone break out in sweat, at first glance. But as someone on Reddit once said, the ‘perceived complexity’ of Angular is far more than the reality.

Nevertheless, it does have a very weird learning curve. Ben Nadel sums up the feeling you get while you’re learning AngularJS superbly in one succinct blog post. The learning curve is more like a gradually scaling zigzag, rather than say, a hockey-stick.

2. Insufficient Documentation

Although it’s improving, many developers shy away from Angular because they feel the documentation does a poor job of covering up the framework properly. Since the community is still experimenting mostly and there are little-to-no official set of ‘rules’, the documentation is where people turn to find resources. If it’s lacking (I don’t think so, by the way), it puts them off.

3. Debugging Scopes

That’s one nightmare with Angular. Angular evaluates expression against scope (like JavaScript does with window. The scopes are placed hierarchically in a nested structure similar to the DOM structure of an app. Debugging them, even with the help of tools made specifically to help you visualize the nested scope structure, can be a pain.

Tl; DR

Here’s what the entire AngularJS Pros and Cons debate boils down to:

PROS:

  • Automatic DOM Manipulation
  • Better refactoring with dependency injections and rigorous unit and end-to-end testing
  • Logical paradigm: You get a neatly divided architectural structure for development.  A separation of concerns makes you work smarter and faster.
  • Great for Single Page Applications Goes a step beyond AJAX and pays due attention to elements you would say belong to UX category: inline form validation and bookmarking.
  • RESTful APIs Can be hooked easily with other systems via filters.

And CONS:

  • Learning curve
  • Insufficient Documentation
  • Scopes are hard to debug

Bottom Line

Angular JS is super efficient in the weirdest way possible (at first glance), and once you learn it, you wonder how you ever managed to work without this framework.

True story, because it’s my own.

Related Articles

  • The Easy Way to Build A WooCommerce Restaurant Website

    As a restaurant owner, there are a number of ways you can benefit from building a WooCommerce restaurant website. For example, you can offer online ordering options to customers, automate order processing, and potentially increase sales. Creating a functional restaurant…

  • The Three Types of Service Organization Control Reports

    The primary purpose of a service organization control (SOC) report is to help your service organization or company communicate information in regards to your controls. The report will be given by an independent service auditor (who must be a certified…

  • Bar Preparty Identity

    The unique identity of a bar attracts thousands of customers and increases sales. Let’s see how the unusual bars around the world look and let’s learn more about the trends in their design. Types of bars: Lux-format. To decorate such…

Written By
Tracey Jones

Tracey Jones is a front end developer at HireWpGeeks and a professional writer who has been actively writing useful and Insights on Wordpress and web design development technologies. Get in touch with her, if you are planning to hire Wordpress developers to customize your Wordpress theme.

Leave a Reply

Your email address will not be published. Required fields are marked *