angular
and react
? How to choose between the two?
Currently, there is a big project that needs to be refactored, because I have never used various MV*
frameworks on the market before, so I am now considering whether to use react
to manage view
, but after all, it is just view
, so I’m thinking about not going directly to angular
.
Actually, I suddenly felt that You Xiaoyou’s introduction on the
vue
official website is very good, why not take a look:Talk about shortcomings,
Angular, with a lot of Java flavor, the framework is large, has many concepts, and has complex syntax. TypeScript is also introduced later. Upgrading from 1 to 2 almost becomes a new framework. It feels too bloated. The front-end problem is very simple. Why? It’s so complicated.
React, a lot of Facebook flavor, JSX, Webpack, Babel. The concept is to make more and more appointments as you go to the back. And recently, I feel that the community is too radical, as if the ecology has not been completed yet, it has attracted a lot of people to rush in. , gradually bringing all kinds of private goods inside.
Vue, after all, Xiaoyou alone can’t defeat a big company...
Look here for Angular: https://ruby-china.org/topics/27590#reply7
React is not a framework, there is no comparison. Just use React for small and medium-sized projects with a few pages. If you don’t have the architectural capabilities for large-scale projects, just use Angular. In fact, Angular is lagging behind (or mature) in many aspects. I have almost said this in the link above. However, ordinary developers do not need to consider these (after you realize this, you will not be ordinary). , you will naturally make your own judgment at that time).
Some people actually say that React is not a framework and is forced to be lightweight. When you use it, don’t you use the full set of react-route+redux+react together
angular1 To be honest, there are no shortcomings. In a five-year framework, all the pitfalls that need to be overcome have been overcome. If I want to do two-way binding, except for avalon, which uses VBS to play tricks, only dirty check is compatible with IE8
As for the architecture, It’s not his fault that the design is complex. Angular itself is a large and comprehensive framework. The only thing missing is state management
Then react, the same thing, coupled with redux, realizes state management, which is the direction of future big applications. By the way, angular2 can also use redux
Furthermore, I don’t think ecma6 has the advantage of syntax, just syntax sugar, there is no essential change (the real qualitative change is that ie9+ supports getters/setters)
A language as complex as Java is just used to writing js
There are really people Do you think it’s good to mix js and html like react itself (not counting webpack)? It’s so anti-human
About
Angular
和React
,其区别其实非常之大。Angular
是一个MVC
框架,因为其涵盖MVC
全部的内容,所以它几乎能代替大部分后端的工作,特别是其双向数据绑定等功能,可以说使用相当方便(但学习成本也高)。但缺陷就是Angular
过重,前端大部分情况下并非需要一个完整的MVC
框架,因为大部分逻辑应该
交给后端来完成。这也导致了Angular
永远无法登上台面,一个正常的网站不会容忍一个为了功能全面而大幅消耗性能的框架。所以Angular
大部分时候只能藏于身后,在一些后台管理页面中使用。React
则不同,其最大的优势就是其轻量级,Facebook
看到了前端使用MVC
框架的劣势,而前端大部分时候只有View
的操作,所以React
只着重于View
层的开发。特别是其Virtual DOM
的思维,大幅提升前端页面渲染的速度。由于其轻量级,所以得以在大流量网站上使用,例如React
研发所针对的Instagram
上已经使用,还有阿里版变种的Weex
is also used on Taobao and other websites.The biggest difference between the two is the difference between light and heavy. The suggestion is to use
React
,小访问量重逻辑的页面用Angular
for pages with large traffic and light logic.