An overview of the

Vue and React are two popular JavaScript frameworks. What are the differences between them and what are their advantages and disadvantages? I think most junior front-end engineers have this question and are faced with the question of which framework is better for deep learning, so this article will introduce the differences between the two frameworks and their advantages.

The same

  1. Both belong to the MVVM framework
  2. Both have two-way data binding
  3. Both are data-driven UI frameworks
  4. Both use the Virtual DOM
  5. It’s all componentized development

The difference between

  1. Vue provides a number of apis, while React has very few
  2. The idea of Vue is reactive, that is, data can be changed. React is a functional idea, one-way data flow, and immutable data can be realized by combining immutable data
  3. Vue uses Template, React uses JSX (essentially templates)

thinking

All of these are coded in different ways, but it’s often not as simple as it looks. Vue and React differ not so much in writing style as in philosophy. Algorithms and data structures are the soul of programming, and philosophy is the way we choose to live.

Vue and React have their own communities and adherents, and we tend to choose a framework not just for the framework itself but for the entire ecosystem.

Vue provides a lot of templates for us to develop quickly. And the vUE programming way is more like a set of rules for the little white, without any experience can still write a set of easy to maintain, read the code. It is not uncommon for teams to have different coding styles that make it difficult to read and maintain code, and the advantages are disadvantages, because the rules are provided, resulting in less flexible coding. Vue Ecology offers a complete family of barrels, vuex, VUE-Router… And so on; Vue-cli encapsulates Webpack again, which means you don’t have to spend a lot of mental time learning webpack and understanding pulgin when building a VUE project. (Chinese documents are very friendly to Chinese people)

React also provides scaffolding for quick integration of various plug-in libraries. If Vue designed a set of rules, React designed a set of ideas. The react philosophy is the most important part of learning react. ❗️❗️ ️ ️ react ecology also provides a complete set of family bucket react-router, react-redux, mobx. And so on; Modifying react scaffolding may require some knowledge of Webpack. We have a choice problem with integration, do we use Redux or MOBx for data management? Due to the flexibility of React, we feel like flying in a free world when coding. However, if there is no effective communication and agreement among the team, the react code will be coded in the same style, which makes you seriously doubt whether it is the same project!

conclusion

React and Vue are both excellent frameworks, and I encourage you to learn some of them if you have the opportunity. However, vUE and React have been updated all the time, and their respective optimization is very good. The performance gap can hardly be reflected in ordinary projects. How to choose in the actual project I think in addition to thinking about performance, maybe we should think about which team member is better suited for? Programmers at the same level may not be included in this list, but the flexibility of react may make development faster. Vue is a great choice if the team has a big skill gap and the boss doesn’t want to go to CodereView!

I have also recently started to learn to write and record my thoughts on technology at work.

Welcome to comment, if you think it is helpful, please click a like! Thank you