and why, exactly, are developers still using and recommending it?Opinionated ArchitectureReact is more geared towards being as flexible as possible, giving developers the choice of architectures and structures.
Angular, however, enforces a certain structure onto the project.
Angular operates on a highly opinionated architecture — which means that your Angular app has to be written in a certain way for things to work properly.
While this may sound rigid, the major perk is that once you learn the structures, every Angular app that you’ll ever come into contact will have something similar.
You can always expect the three piece creation of css, Angular component and html for your view at minimum.
With React, it’s flexibility is also its weak point where junior or new React developers can create without restrictions, baking into bad practices or shaky architectures.
It’s not their fault, not really.
Best practices come to fruition after enough mistakes have been made and best known solutions come to light.
Angular forces these solutions on you in order to maintain a sense of cohesion in the way things are done.
Historically, this wasn’t present in Angular.
The original version of Angular had a more free reign approach, similar to React’s ability to coincide with any existing application.
However, as applications grew and teams changed, there’s a higher chance of the application breaking separations of concerns, resulting in a glop of code that eventually needed to be thrown out.
Angular’s new and enforced approach to architecture solved this issue, resulting in applications that are uniformed with a certain level of industry standards enforced.
The CLIThe CLI has come a long way over the years, generating bare bones templates that utilizes best practices and structures.
React also has a CLI too but there is a difference between the two semi-official tools.
As frontend development grows in complexity, CLI is a tool to help get things up and running much faster through generations of templates in spaces that you need and want.
Angular’s CLI is robust with the ability to generate code on the scaffold generated, making it highly flexible when adding new logic and components into the application.
The bundling features built into the CLI also allows for further debugging and optimizations.
Deviations are encouraged with the ability to configure your project setup and compilation processes.
From what I can see, React’s CLI isn’t equipped with such functionalities, in part because it is only a UI library and isn’t as beefed up when it comes to potential code related usability features.
Highly Driven CommunityDespite the knowledge hurdles that put off a lot of new front end developers when it comes to Angular, the community is strong and active, with locally run groups like Angular NYC.
Google also advocates for Angular as well, running a full calendar of events on a global scale with 41 sponsored conferences and workshops this year — up by 10 events from 2018.
Angular’s half yearly update cycle therefore starts to make sense.
Every time Angular releases a new version, it is not discarding the old completely.
Rather, it is adding any new features, revelations and optimizations.
Due to the it being a framework — which results in a complete UI, state management and architectural system, among many things — it has more space to grow in potential and functionality than React.
There is no doubt that React is limited by its scope.
However, it’s limitation is what makes the library popular (besides being affiliated with Facebook).
But it is Angular’s native and built-in wide coverage that differentiates and retains a certain portion of the development community that React hasn’t quite able to convert.
Final wordsThe battle between Angular and React can be rather opinionated from both sides.
But it is wise to note that they are two very different things in terms of scope and architecture that ultimately produces a front end solution.
They both solve issues that the other doesn’t adequately address — and depending on the situation, one solution might be better than the other.
Let’s stay connected and join my awesome web digest newsletter list.
Thank you for reading.
❤Aphinya.. More details