编程知识 cdmana.com

Why did I choose react over Vue?

At present, the three main front-end frameworks are :React、Vue、Angular, They are very good at using them in their own specific scenarios . among ,Vue It's a good progressive JavaScript library , Easier to style development and build UI. And I'm more inclined to choose React, because React With unique advantages :

  • React The idea of functional programming makes the code more elegant and reasonable
  • Rigorous one-way data flow design , Easy to build large, complex and stable single page applications
  • A rich technology ecosystem , Technology support from all over the world
  • It's convenient to cooperate ReactNative Develop cross terminal applications

image-20201225110733248

React Functional programming makes code more elegant and reasonable

Functional programming is programming with a combination of functions , Declare function first , And then call the function. , Each step has a return value , Abstract by extracting each step of logical operation , Encapsulated in functions . Then combine the functions to write the program . for example : Calculate the average percentage , We can split it into three functions , One is to calculate the average , One is to calculate the percentage , One is a function called synthetically , By nesting functions , Make the code more elegant , Better for reuse .

image-20201225110746610

React Use the idea of functional programming to make the code more elegant and reasonable , More conducive to componentization 、 Modular development .React Every component of is function generation , The essence of the page rendering process is the nested function calling process .React This design is very convenient for use , For example, the following subcomponents nest subcomponents and then nested subcomponents : The nested subcomponent call pattern in a subcomponent is always the same . When a parent component calls a child component, it only needs to consider the parameters passed props, The subcomponents only need to consider the parameters passed in .

image-20201225111238480

Rigorous one-way data flow design , Easy to build large, complex and stable single page applications

React The data flow is always designed in one direction , Strictly follow data driven DOM. The advantage of this is , Reduce the code coupling of components communicating with each other , The data flow is clearer , Debugging is more convenient . Large scale complex single page applications have always been a problem for enterprises , The traditional way of development can not be well maintained . While using React Based on the technology stack , It's easy to split modules 、 Components , Combined with Redux Data flow management , It can build applications efficiently . The fact proved that , such React、Redux Large complex single page project construction scheme , It has been applied and developed in major Internet companies .

image-20201225111257961

A rich technology ecosystem , Technology support from all over the world

React By Facebook High quality modern front-end framework developed by the company , With high authority and professionalism , Supported by the major technology communities around the world , Including the domestic technology community . such as ,npm Official website 、 TaoBao cnpm Communities and so on are rich in ecology . A lot of developers work together , Open source sharing , Enriching the technology ecosystem , Make it easy for us to learn and use based on React The components of 、 plug-in unit , Reduce development costs , Improve development efficiency . At home , Developed by Alibaba based on React Basic development Antd Component library is well received by Internet enterprises , Open the box , In order to accelerate the development of small and medium-sized enterprises in China 、 Informatization has played an important role .

It's convenient to cooperate ReactNative Develop cross terminal applications

An important problem for Internet companies is : How to reduce costs 、 Efficient cross terminal application development . in other words , Internet companies want to be able to develop iOS、Android、H5 application .React coordination ReactNative Library can easily develop cross terminal applications .ReactNative Design principle and React Agreement , Used React Technology stack , You've got the foundation , Combined with ReactNative You can have a code , Compile to generate multiterminal applications .ReactNative Convenient for many companies to develop quickly and efficiently App, Reduce R & D costs , Increased productivity , Reduced development time .

React、Vue Development trend

React More emphasis on functional programming . From now on 16.7 After the version , There is Hook The idea of function hook , Can only be React Only functional components can be used . This characteristic is obvious ,React I hope to make full use of functional programming , Better and better project development . Interestingly , It's here useMemo function , It's like Vue Medium computed The role of , here React It's a reference Vue The dynamic listening mode of variables .

Vue The development trend of project standardization is to pay more attention to project standardization 、 Preciseness . stay Vue3 Has already been used in TypeScript Instead of being less strict JavaScript How to write it . And introduce TypeScript This is a reference React It's a deep fusion TypeScript More rigorous development experience .

React、Vue The trend shows that , The two frameworks draw on each other , Learn from others' strong points and close the gap , All for better application development .

How to choose the right framework

face React、Vue, How should we choose . Here are some ideas :

  • Small projects are more important, and if they are, they are UI show , More style development , Recommended Vue. Develop Vue The advantages of template styles .
  • With complex data logic applications, such as the China Taiwan chemical project , It is recommended to use React. The pattern of one-way data flow can avoid data logic errors .
  • Large complex single page project , recommend React. In combination with Redux、Mbox Wait for the status management library , Componentization 、 Modular development , Effective management .

At the end

React、Vue All excellent front end frames , Each has its own place .React Framework of functional programming concept 、 Rigorous one-way data flow design 、 Rich technology ecosystem and convenient development of cross terminal applications have greater advantages . We have to use it according to the scenario 、 Business needs 、 Technology implementation and other comprehensive factors to choose the most suitable framework , To give full play to the greatest advantage , raise productivity .

image-20201225111711634

ending

So much for this issue , I'm Xiaobian. The wind blows from the south , Focus on sharing, fun and fun 、 novel 、 Practical open source projects and developer tools 、 Learning resources !
I hope to learn and communicate with you , Welcome to my official account. 【Github Navigation station 】.

111

Previous recommendation

3000 Multiple visits to one html file , How much broadband is enough to support

Programmers must have a background framework for private work , You don't have to make wheels again , Net friend : It's great to use !

Still working on projects from the beginning to the end ? this 6 individual SpringBoot The project is well used , Yield twice the result with half the effort !

much , This programmer code completion tool , Let your programming efficiency fly !

「00 After abbreviation black words translator 」 On the GitHub Hot list , Middle aged netizens can finally understand young people's awsl

It was so cool, ! This open source Android projection software , Let you work and play !

版权声明
本文为[GitHub navigation station]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201225114149258i.html

Scroll to Top