React, Vue, and Angular are the three main front-end frameworks that work well in their own specific scenarios. Vue is a nice progressive JavaScript library that makes it easier for style development to build uIs. I prefer React because React has its unique advantages:
- React’s functional programming philosophy makes code more elegant and rational
- Rigorous one-way data flow design facilitates the construction of large, complex and stable single-page applications
- Rich technology ecosystem, with worldwide support from major technology communities
- Easy to cooperate with ReactNative to develop cross-terminal applications
React functional programming makes code more elegant and sensible
Functional programming is to use a combination of functions to program, first declare the function, then call the function, each step has a return value, by extracting each step of the logical operation abstraction, encapsulated in the function. Then combine the functions to write the program. For example: to calculate the average percentage, we can split into three functions, one is to calculate the average, one is to calculate the percentage, one is to call the function comprehensively, through the function nested function way, making the code more elegant, more conducive to reuse.
React uses functional programming ideas to make code more elegant and rational, making it easier for componentized, modular development. React components are function generation, and the page rendering process is essentially nested function calls. React is designed to be easy to use, such as nesting subcomponents within subcomponents. Example: Nesting subcomponent invocation patterns within subcomponents are always the same. The parent component calls the child component only with regard to the parameters passed, and the child component only with regard to the parameters passed.
Rigorous one-way data flow design facilitates the construction of large, complex and stable single-page applications
React’s data flow is always designed to be one-way, strictly following the data-driven DOM. The benefits are reduced code coupling between components to communicate with each other, clearer data flow, and easier debugging. Large and complex single-page applications have always been a difficult problem for enterprises, and traditional development methods can not be well maintained. The React based technology stack can easily split modules and components, and with Redux data flow management, it can efficiently build applications. It has been proved that the React and Redux large complex single-page project construction scheme has been applied and developed in major Internet companies.
Rich technology ecosystem, with worldwide support from major technology communities
React is a high-quality modern front-end framework developed by Facebook. With high authority and professionalism, React is supported by various technical communities around the world, including those in China. For example, NPM official website and TAOBAO CNPM community have rich ecology. A large number of developers contribute to the technology ecosystem by sharing it open source, making it easy for us to learn and use React based components and plug-ins, reducing development costs and improving development efficiency. In China, the Antd component library developed by Alibaba based on React is well received by major Internet enterprises. Out of the box, it plays an important role in accelerating the modernization and informatization of small and medium-sized enterprises in China.
Easy to cooperate with ReactNative to develop cross-terminal applications
At present, an important problem for Internet companies is how to reduce the cost and efficiently develop cross-terminal applications. In other words, Internet companies want to develop iOS, Android and H5 apps. React works with the ReactNative library to make it easy to develop cross-terminal applications. ReactNative’s design principle is the same as React’s. With React stack, the foundation has been established. With ReactNative, a set of code can be compiled to generate multi-terminal applications. ReactNative is convenient for many companies to develop apps quickly and efficiently, reducing r&d costs, improving productivity and reducing development time.
React and Vue trends
React’s trend is toward more functional programming. React-like components can only be used with React components. This feature is obvious, and React wants to use functional programming to its best advantage. Interestingly, the useMemo function appears here, much like computed in Vue, where React borrows Vue’s model for dynamically listening on variables.
The development trend of Vue is to pay more attention to project standardization and rigor. Vue3 already uses TypeScript as an alternative to less stringent JavaScript writing. The introduction of TypeScript builds on React’s ability to deeply incorporate TypeScript’s more rigorous development.
React and Vue development trends show that the two frameworks learn from each other and complement each other to better implement application development.
How to choose the right framework
React/Vue Here are some ideas:
- For small projects that focus on UI presentation and more style development, Vue is recommended. Take advantage of the Vue template style.
- React is recommended for applications with complex data logic, such as Chinese platform projects. The one-way data flow pattern avoids data logic errors.
- React is recommended for large, complex, single-page projects. Then cooperate with such as Redux, Mbox and other state management library, componentized, modular development, effective management.
Write in the last
React and Vue are both great front-end frameworks that have their place. React framework features functional programming philosophy, rigorous one-way data flow design, rich technology ecosystem, and convenient cross-terminal application development. Only by selecting the most suitable framework according to the application scenario, business requirements, technical implementation and other comprehensive factors can we give full play to our advantages and improve productivity.
At the end
This issue is to share here, I am xiaobian South wind blowing, focus on sharing interesting, novel, practical open source projects and developer tools, learning resources! I hope to learn and communicate with you together. Welcome to follow my official account ** [Github navigation station] **.
Phase to recommend
3000 + people accessing an HTML file, how much broadband is enough to support
The programmer connects the private life necessary background frame, need not repeat to build the wheel, net friend: too easy to use!
Still working on the project from start to finish? Use these six SpringBoot projects well, get twice the result with half the effort!
Fierce, this programmer code completion tool, let your programming efficiency fly!
Middle-aged netizens can finally understand young people’s AWSL
Cool! This open source Android projection software will let you work and play both!