Home Web Front-end JS Tutorial JS front-end framework's failure experience sharing on refactoring_javascript skills

JS front-end framework's failure experience sharing on refactoring_javascript skills

May 16, 2016 pm 05:40 PM
front-end framework Refactor

Okay, let’s get started
Refactoring is actually not a big move. The main function to be achieved is to re-divide the existing JS code and decouple the existing modules. Then I plan to divide the existing program into modules and repackage it into a namespace to implement use or something similar to Java's Package. Then I only need to load a use js file and call the use function of this file. By setting certain parameters, I can dynamically load the required modules. This was the most perfect idea (I was stupid and naive at the time). OK, the nightmare begins.
Premise, I underestimated myself 3 months ago. //Okay, uncivilized terms may appear below~~

First of all, on the first day of the plan, my intention is to separate the most decoupled part of this program, the self-made control part. Speaking of which, people have also tried to write some form controls such as Panel.js, Button.js and other controls. There are a lot of js files in them. Although I have divided the folders, but when I see the index page That series of

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the code complexity error in Python code? How to solve the code complexity error in Python code? Jun 24, 2023 pm 05:43 PM

Python is a simple, easy-to-learn and efficient programming language, but when we write Python code, we may encounter some problems with excessive code complexity. If these problems are not solved, it will make the code difficult to maintain, error-prone, and reduce the readability and scalability of the code. So, in this article, we will discuss how to resolve code complexity error in Python code. Understanding Code Complexity Code complexity is a measure of the nature of code that is difficult to understand and maintain. In Python, there are some indicators that can be used

How to solve the poor maintainability error of Python code? How to solve the poor maintainability error of Python code? Jun 25, 2023 am 11:58 AM

Python, as a high-level programming language, is widely used in software development. Although Python has many advantages, a problem that many Python programmers often face is that the maintainability of the code is poor. The maintainability of Python code includes the legibility, scalability, and reusability of the code. In this article, we will focus on how to solve the problem of poor maintainability of Python code. 1. Code readability Code readability refers to the readability of the code, which is the core of code maintainability.

How to refactor Java code well How to refactor Java code well Jun 15, 2023 pm 09:17 PM

As one of the most popular programming languages ​​in the world, Java has become the language of choice for many businesses and developers. However, code refactoring is crucial to maintaining code quality and development efficiency. Java code can become increasingly difficult to maintain over time due to its complexity. This article will discuss how to refactor Java code to improve code quality and maintainability. Understand the principles of refactoring The purpose of Java code refactoring is to improve the structure, readability and maintainability of the code, rather than simply "changing the code". because

In-depth understanding of function refactoring techniques in Go language In-depth understanding of function refactoring techniques in Go language Mar 28, 2024 pm 03:05 PM

In Go language program development, function reconstruction skills are a very important part. By optimizing and refactoring functions, you can not only improve code quality and maintainability, but also improve program performance and readability. This article will delve into the function reconstruction techniques in the Go language, combined with specific code examples, to help readers better understand and apply these techniques. 1. Code example 1: Extract duplicate code fragments. In actual development, we often encounter reused code fragments. At this time, we can consider extracting the repeated code as an independent function to

React vs. Vue: How to choose the right front-end framework React vs. Vue: How to choose the right front-end framework Sep 26, 2023 am 09:15 AM

Comparison between React and Vue: How to choose the right front-end framework In front-end development, choosing the right framework is crucial to the success of the project. Among the many front-end frameworks, React and Vue are undoubtedly the two most popular choices. This article will help readers choose the front-end framework suitable for their own projects by comparing the advantages and disadvantages, ecosystem, performance, and development experience of React and Vue. 1. Comparison of the advantages and disadvantages of React and Vue Advantages of React: Component development: React splits the UI into

Optimization and refactoring methods in Go language Optimization and refactoring methods in Go language Jun 02, 2023 am 10:40 AM

Go language is a relatively young programming language. Although from the design of the language itself, it has taken into account many optimization points, making it efficient in performance and good maintainability, this does not mean that we are developing Go applications do not require optimization and refactoring. Especially in the long-term code accumulation process, the original code architecture may have begun to lose its advantages. Optimization and refactoring are needed to improve the performance and maintainability of the system. This article will share some optimization and refactoring methods in Go language, hoping to be helpful to Go developers

React code refactoring guide: How to improve the code structure and readability of front-end applications React code refactoring guide: How to improve the code structure and readability of front-end applications Sep 26, 2023 am 08:37 AM

React code refactoring guide: How to improve the code structure and readability of front-end applications. In front-end development, code structure and readability are crucial to the maintenance and expansion of the project. As the project scale gradually increases and the code becomes more complex, we need to refactor the code to better organize the code and improve maintainability and readability. This article will introduce how to refactor React code from the following aspects and provide specific code examples. 1. Component splitting In React development, splitting into smaller components is an effective way to refactor code.

Is Vue used for frontend or backend? Is Vue used for frontend or backend? Apr 03, 2025 am 12:07 AM

Vue.js is mainly used for front-end development. 1) It is a lightweight and flexible JavaScript framework focused on building user interfaces and single-page applications. 2) The core of Vue.js is its responsive data system, and the view is automatically updated when the data changes. 3) It supports component development, and the UI can be split into independent and reusable components.

See all articles