Why Angular

I wrote an article called  Angular Versions, and later on renamed it Angular Version Change Frequency, and this article used to be part of it. However, it seems that the article is a little bit too long, so I pulled this part out as a stand alone.

Introduction

Before I answer why Angular, I will explain what Angular is.

This is the structure of this article,

  • Introduction
  • What Angular is
  • Why Angular
  • Summary

What is Angular?

I will not answer this question in my own words, instead, I use the wiki definition below"

"Angular (commonly referred to as "Angular 2+" or "Angular CLI") is a TypeScript-based free and open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations. Angular is a complete rewrite from the same team that built AngularJS."

I think this paragraph from Introduction to Angular can add more info and very briefly:

"Angular is an open-source project maintained by Google and a community of developers. The new Angular platform is vastly different from the legacy framework you may have used in the past. In collaboration with Microsoft, Google made TypeScript the default language for Angular. TypeScript is a superset of JavaScript that enables developers to target legacy browsers such as Internet Explorer 11, while allowing them to write modern JavaScript code that works in evergreen browsers such as Chrome, Firefox, and Edge. The legacy versions of Angular, versions in the 1.x.x range, are referred to as AngularJS. Version 2.0.0 and higher versions are called Angular. Where AngularJS is a monolithic JavaScript SPA framework, Angular is a platform that is capable of targeting browsers, hybrid-mobile frameworks, desktop applications, and server-side rendered views."

Why Angular

Angular is popular and in recent years, a lot of .NET developers and Java developers switched to Angular for front-end development. If one asks: Why do we choose Angular?  This is a question for all Angular developers and actually is a frequent interview question.

Not Due to the Minor Technical Reasons

If we search online, we can get a lot of answers for this question, such like 

However, those answers are too technical and did not catch the basic point, in my opinion. I list the articles in the reference with some details, for example, one reason to use Angular is that Angular uses TypeScript. Yes, TypeScript is a good feature for Angular, but React does not use TypeScript, why it is just as popular as Angular?

Due to the Major Software Evolution Trends

I prefer this definition as a reason to use Angular [ref]:

"Angular helps build interactive and dynamic single-page applications (SPAs) with its compelling features including templating, two-way binding, modularization, RESTful API handling, dependency injection, and AJAX handling."

From this definition, we can see: Angular Platform have two major characteristics,

  • SPA --- Remoting access to the server
  • compelling --- this feature make it faster and secure

Let us examine the Software evolution, and then Web App evolution. 

The Software development architectures evolution (I previously discussed in ASP.NET Core, Web API - Entity Framework Call Stored Procedure)

  • Server-side programmings, such as IBM mainframe or UNIX server with a dumb terminal
  • Client-side programming, such as HTML page with Dynamic javascript
  • Client-server architecture, such as ASP webserver/page
  • Three-tier architecture, enterprise business architecture
  • SOA: service-oriented architecture, also loose-coupled enterprise business architecture
  • Microservice architecture: loose-coupled architecture with application scope

Then, specifically, we examine,

Web Development Architectures evolution

  • Client-side Programming:
    • HTML --- early 90 age, Static Web Pages
    • JavaScrip --- The similar age of HTML, to make web page dynamic
  • Server-side Programming:
    • VB (before .NET in 2002) to render code to web, such as WebBrowser
    • ASP age 
      • Front end: VB Script
      • Back end: JavaScript
      • Mixing Script Code and HTML together
    • ASP.NET:
      • Separate front end with
        • Design Mode --- HTML
        • Code-behind --- C# code, compilable
    • MVC --- separates the frond-end as 
      • Model
      • View
      • Controller
  • Client-side to Server:
    • RDS --- Remote Data Service
    • Microsoft OLE DB Remoting Provider Overview
    • AJAX
    • JavaScript libraries: such as jQuery --- Encaplate AJAX
    • Silverlight --- Thick client with Encapsulation to Ajax, Silverlight 5
  • Decoupled Server and Client: link server and client by remote access
    • SPA --- Client side:
      • Angular --- compiled
      • React
      • Vue
    • Web API:--- Server-side
    • REST --- architectural style, see REST(1), In Concept 
      • Client-Server
      • http protocol --- stateless
      • JSON format --- uniform interface

Examine the different Approaches,

  • Client-side Programming: No server access --- no data, no security; no compiling 
  • Server-side Programming: Server rendering page by page to client-side, slow; no client-side compiling 
  • Client-side to Server: have remote access to the server; no client-side compiling
  • Decoupled Server and Client: by REST to make it happen, where Angular plays an important role as SPA.

Summary

Why do we use Angular? Because we want to make a decoupled system by SPA with remote access to server feature, and client-side compiling to make the code faster

Reference


Similar Articles