This article was first published on my CSDN
'Lazy cancer kills'
In the last article, I wrote that if you don’t learn new jquery, you will lose your job. Although it is a bit alarmist, the reality is true.
Vue, React, Angular Contrast and choice I wanted to write about this topic back in the Vue1. X era in 2016, but time flies, lazy cancer attack, one stranded for so many days. Vue is 2.5, Angular is just another framework, and JavaScript frameworks are evolving so fast.
If there are students who do not know the concept of MVVM, please review my fifth chapter: second understand the history of front-end framework and MVVM framework principle!
I don’t think there is anyone else who can explain this topic in such plain English and with so much saliva.
Reviewing this article, I was also surprised at how clear and careful my thinking was at that time, and how handsome my writing style was (I admire myself a year ago).
"We divide the world three ways."
The Vue, React and Angular frameworks are three different things, three different parts of the world. As it happens, I am half a history fan. How can we personify these three things based on my previous humor style?
So after we anthropomorphize, how should we position and compare them? According to my own understanding, I would like to distinguish them in this way, if you would like:
Vue.js – Shu kingdom of The Three Kingdoms, spokesperson – Liu Bei, Zhuge Liang
Author: You Yuxi (personal entrepreneurship, grassroots counter-attack)
Characteristics: small but strong, personal entrepreneurship, fast counter-attack, short and fast lightweight framework, smooth learning curve, many grassroots civilian supporters, rapid development and popular. Suitable for raid cavalry combat, plug and play, but also suitable for unity, negotiation, and pro all development methods can do anything, in short, is flexible, good performance, not too much restrictions, a Zhuge Liang +3 big brothers hold up a VUE community, Shu has been such a feature and vUE is very similar.
React. Js – Wu kingdom of The Three Kingdoms, spokesmen – Sun Quan, Zhou Yu
By: Facebook Team (started as a team, rich family)
Features: flexible, tactical complete, ecological perfect, ecological level framework, medium learning entry curve, civilian and local jiangdong old supporters, many supporters of Facebook system products, rapid development, steady capture of cities and land, thick accumulation and thin development, unified and componentized concept is popular.
The State of Wu has systematic belief, but also likes to fight in a balanced and stable way. The State of Wu always likes to recruit talents. For those who like to give advice and contribute to the community, the State of Wu is like heaven.
AngularJs – Wei kingdom of Three Kingdoms, Spokesperson – Cao Cao
Author: Google employees (who started their own business, then were recruited by Google, and from few to many supporters)
Characteristics: Just like Cao Cao himself, the historical evaluation is mixed, multiple personality, extraordinary achievement, huge power, the earliest entrepreneur, step by step to conquer cities and territories, a large family, perfect framework, organization coordination is full, is a real framework, solutions and theoretical support perfect, everything; But it’s too big, a little clunky and dull, with lots of rules and a steep learning curve.
Wei was one of the first three kingdoms to have the concept of state and a series of systems, so if you want to change the structure of NG, just like when you are an official in Wei, you have to be instructed by your superiors. Wei was a paradise for those who liked the system and wanted to get things done with resources. AngularJs is the system of Wei, rigorous and massive.
Image? Stimulus? Interesting? Using the metaphor of The Three Kingdoms is really appropriate, even the author’s background and the three frame attributes are so fit, we are really handsome.
The author of VUE, You Yuxi, was a small employee in a department of Google. He got up early to work with Cao Cao, and Cao Cao’s Angular was already out. He hated it and couldn’t work with cao Cao. Finally, combining the advantages and disadvantages of the two, we successfully opened Vue and gradually established the kingdom of Shu.
This is the connection between the three frameworks, which is exactly the same as the founding of The Three Kingdoms, but now in the open source era, everyone is free and there is no competition and killing, there is only a question of who copies who (laughter).
To say how awesome the framework is without saying how expensive it is to learn is a bully
I’m not going to be a rogue because I’m a rogue. Ok, now let’s compare the learning curve problem in this essay. The learning curve means introducing all the systems, foundations, technologies and tools to be learned in the three frameworks, just like the politics, military and people’s livelihood of the three countries. It is a big project. Please point out any mistakes or shortcomings.
Important statement: this article does not post code, first do a brief introduction, the next chapter in the comparison of each feature
Don’t be scared, in fact, not so scary, but HTML, CSS, ordinary JS level you have to have, if you don’t even know HTML, then go to see my first few basic introduction and books, this really can’t bit by bit to hand over you, like you want to drive, driving license I have to give you the same reason.
"Characteristics of The Three Kingdoms killing Countries"
First of all, these three frameworks are MV ** series, what is MVVM, MVC I briefly talked about in the previous article, to say the back end, the traditional desktop development of a set of ideas slowly applied to the front end, this is a progress, but also an unstoppable trend, against the trend is not want to pay.
Cao cao – AngularJs
Why do I mention him first? Because he is the earliest and largest front-end MVVM framework, can be said to be the pioneer of this kind of framework, ironically, the author was a JAVA engineer, front-end framework is a JAVA engineer, so you know how many foreign cool people.
Angular does have a steep learning curve. It’s fully documented, but you can still be scared to cry.
Angular is a framework rather than a library because it provides strong constraints on how applications are built and more out-of-the-box functionality. Angular is a “complete solution” – full of features that you can happily start developing. You don’t need to research libraries, routing solutions or anything like that – you just get to work.
But Angular also has the always confusing build tools, templates, checkers, etc. It is really big and comprehensive, with all kinds of dependencies, and the whole Idea of Java is perfect in this framework.
Have back-end experience to the front end or want to understand the front end of the research this or can, because a lot of terms and Java also close, after all, the author is Java department. At present, more and more ng series products are abandoned in China, because they are too large, rigid, and their advantages are not as good as their disadvantages. Moreover, the domestic NG ecology is not good, and the document translation is poor, so there are many companies and products in the two camps, Vue and React, but ng ecology in foreign countries is still very good.
Sun quan – React. Js
React in front modular development ideas of promoting the Fried chicken, modular development now become the standard in the front-end complex business products, and finally can like PGP, Java function block componentization separation, plug and play, don’t throw them, management project coupling, business logic function were also more likely to split, Compared to the JQ era, this is certainly facilitated by es6’s modular writing support.
At present, many ideas and writing methods are basically developed and open source by people like Facebook. Vue’s componentization, state management and even server rendering all have its shadow, even the name is similar, which shows how deep the technical strength and ecological skill of this team is.
JSX 还是 HTML
React breaks long-held best practice. For decades, developers have tried to separate UI templates from inline Javascript logic, but with JSX, these are mixed again. It sounds bad, but you should listen to Peter Hunt’s talk on React: Rethinking Best Practices (October 2013). He points out that separating templates and logic is simply a separation of technologies, not a separation of concerns. You should build components, not templates. Components are reusable, composable, and untestable.
JSX is an optional preprocessor with htML-like syntax that is subsequently compiled in JavaScript. JSX has some quirks — for example, you need to use className instead of class because the latter is a Javascript reserved word. JSX is a great advantage for development, because the code is written in one place, making it easier to check the work when the code is finished and compiled. When you type an error in JSX, React will not compile and will print out the wrong line number. – I still like HTML, so I use VUE more
Major learning and adapt to the React curve right here, you’ll have to be familiar with the JSX syntax, a magical grammar, what other redux what this is all standard bucket is easy to master, ecological improvement, learning curve of medium, and problems in the search engine can find many answers, visible in the domestic popularity is also very high.
Most importantly, he has a brother, ReactNative, who specializes in hybrid APP development. He supports him very friendly and is a standard tool. Therefore, many companies choose the React camp.
Zhuge Liang – vue.js
To say that this person is not god is no one to believe, master of art but wrote the most popular front-end framework Vue in recent 2 years, this may be the genius of all?
Let’s not discuss how this person is, just because he is Chinese, yellow skin has doomed Vue to be popular in China, because the official Chinese document is the most organized and intuitive document I have seen so far. Even better than the local BAT out of many open source to write, are you ashamed?
Vue seems to be the lightest of the three, and they like simplicity — the source code is very readable and doesn’t require any documentation or external libraries. It’s all very simple. Vue. Js “makes no big assumptions about anything.” A major disadvantage of React compared to Vue is that components are much smaller in granularity due to JSX limitations,
Vue officially emphasizes that it is easy to get started and does not break away from the original HTML, CSS, JS front-end development habits is its biggest feature, so the learning curve is very stable, and it is more acceptable and accessible to pure front-end staff. Vue1.0 is a library similar to JQ, with many third-party plug-ins and frameworks at will. At that time, even the official routing was not perfect, so I combined with a lot of third-party solutions, which felt perfect, for example, routing using direct, Ajax simply extract jquery $. Ajax, and render UI using Vue syntax, actually quite nice. Later, the VUE2. X family barrel series also improved a lot, but the corresponding configuration and some terms are also a lot more complex, which is also a trend, after all, the ecology is more and more perfect, the demand will be more and more, the natural framework will be more and more huge.
Vue developers also have a stable team, is not a Zhuge Liang +3 big brothers, and Taobao WEEX framework is based on VUE specifically customized, but now WEEX is still a lot of pits, this to be careful.
Volume, performance and usage
No framework is perfect: The Angular framework is very bloated. The gzip file size is 143K, while Vue is 23K and React is 43K.
React and Vue both use the Virtual DOM to improve performance. If you’re interested, read about the differences between the virtual DOM and DOM and the practical advantages of the virtual DOM in React.js. As for the connections and benefits between virtual DOM and DOM, this is another topic, a matter of principle, that we will have the opportunity to discuss later, and that Bema is also working on.
Vue has excellent performance and sophisticated memory allocation techniques. If relatively fast, these frameworks are very close, and we do not have to tangle with the general application layer of the framework performance problem, after all, the application of such a wide range of framework, the basic performance is not very low, the difference is not big, do not tangle.
Finally, compare the downloads and usage data of the three frameworks in the last two years to refer to which “country” you like or think you want to join. You can also experience each country, but in the end you still have to live in one country.
This series is I fall in love with the original, if you feel good want to be reproduced be sure to give me a message for reprint, and indicate the source.
If you feel good about it and the series helps you, don’t say thank you, just put me on top and order ads every day. Ha, ha, ha, ha, ha!
[Web front-end pit series] : Click the title to enter
What is a Web front End? Promising?
Chapter 2: How to learn the Web front end? Dry goods information!
Chapter 3: A “Road of No Return” — the Learning route
Article 4: the web front end into the pit article 4: the web front end | you still use jQuery?
Vuejs, Angular, React, and the history of front-end development
conclusion
I am beima, an Internet man who is afraid that you will suffer losses. I have established a peach blossom island in the complicated Internet and real world, hoping to cultivate evolution and improve together with my friends. Welcome to the island. — > the boiling point