The paper contains 1807 words and is expected to last 6 minutes

Source: codecondo.com


Here we are in 2020, and most people are still hyping the React framework in front end development.


They tout React as a powerful tool for web, desktop, and mobile development that many big companies love.


In my mind, Angular is still the white light after Vue and React.

Love actually lasts.


Each library has its strengths and weaknesses, and choosing a different library for the project makes it a little more difficult. I won’t compare JavaScript frameworks and libraries in depth here, because there’s a lot of stuff on the web about it.


Here, I’ll briefly explain why Angular became my final choice after experimenting with Vue and React.


TypeScript


You’ve heard that TypeScript works with React and Vue.


Indeed, TypeScript is a strongly typed superset of JavaScript, and Angular is built on TypeScript. Ready to use, easy to use. I like TypeScript because it is a rigorously typed language — when types are used correctly, code is easier to understand, manage, and refactor.


For example, by using types, you can know what types of arguments a function takes and what values it returns directly from the IDE. This saves a lot of trouble by not frequently executing console.log () to see the parameters and results of each operation.


The compiler can also pick out type mismatches that are so hidden that they can only be detected at run time. Almost every JavaScript developer has had some experience debugging when dealing with type errors. Of course, there are other ways around this — for example, you can use type-checking propTypes in React, but it’s not as natural as TypeScript and Angular.


TypeScript also has an outstanding advantage: it provides dependency injection, which is widely used in Angular because services and other classes are injected into components so that components can access those classes.


Source: huaban.com


RXJS


RXJS isn’t just for Angular; it can be added to any project and used in much the same way. However, it follows Angular in built-in services such as HTTPClient, which is the available method for making HTTP requests from applications that use Angular. This demonstrates the power RXJS provides with minimal code.


When a GET request is made but the response format is not as expected, adding operators such as switchMap enables you to change and get the data in the desired format. Other changes to the return value can easily be made by adding other operators. In addition, you can build custom operators when you cannot find one that can do the desired operation.


As a result, it is relatively easy to refactor existing code or add additional functionality. RxJS is also useful for state management, allowing you to create an observable and subscribe to multiple parties — it notifies all subscribers when the object changes.


Finally, the “opinionated” Angular framework


In 2015, I started web development by learning Ruby on Rails. The framework is great and I like a lot of things about it, one of which is that it’s “opinionated.” Those unfamiliar with the framework may misunderstand that “opinionated” means that the framework has its own way of handling things that developers must follow (at least to a certain extent).


Some people may not like these restrictions and want the freedom and flexibility to set up their projects. If so, then perhaps they can use the React framework to better control the process of developing Web applications.


What I love about Angular is that when you set up your project using AngularCLI, you immediately get a template engine, router, form validation, RXJS for reactive programming, and a guide on how to build code and how data gets passed around the application. Angular makes it easier for developers to understand and edit other people’s code.


Angular may be harder to learn than Vue and React, but once you get the jump on it, you have an all-in-one framework for hybrid mobile/PWA development (with Ionic 4) that is both Google-supported and well-documented, with multiple features for your next project.


So convenient, why not? Get Angular now!

Leave a comment like follow

We share the dry goods of AI learning and development. Welcome to pay attention to the “core reading technology” of AI vertical we-media on the whole platform.



(Add wechat: DXSXBB, join readers’ circle and discuss the freshest artificial intelligence technology.)