Always want to refactor the entire project
I have been in the IT industry for 7 months, and I am a programmer who has just wet my shoes
Under development, need to learn various knowledge
There are html css javascript vuejs various web front-end frameworks regular expressions php and thinkphp frameworks
and databases
There are too many aspects involved and I haven’t learned much in the past six months. I have to use what I need to read, so I will encounter many problems.
When making bs software, I often find some problems. After solving the problem, I will find that the code I wrote before has left bugs that I never thought of before.
At this time, I had an idea to get rid of all the previous bugs. At this time, the problem came. Some problems were not considered carefully at the beginning, so I just wrote the code directly. If you want to correct it, many places will be affected. You may get dizzy, and if you don't pay attention, you will go back to the previous strange circle.
At this time, I wanted to refactor the entire project code, but another problem arose. The development time required by the product manager was not enough (the function he wanted was expected to be developed in one day, but it actually took me 3 days) , when refactoring code time is more valuable than gold. And the product manager will say every day that it is too slow and needs to be accelerated (the product manager is the company CEO and also my teacher).
Every time this happens, I feel very impetuous and can’t write code with peace of mind. I always think about the bugs in the project.
Let me ask some experts who have the same sentiment as me how to solve this problem.
It is to continue development. After the first version of the product is developed, it is better to develop the second version.
It is better to refactor directly. I personally want to refactor directly so that the program is safer.
This question has been closed due to non-technical discussion
Reply content:
I have been in the IT industry for 7 months, and I am a programmer who has just wet my shoes
Under development, need to learn various knowledge
There are html css javascript vuejs various web front-end frameworks regular expressions php and thinkphp frameworks
and databases
There are too many aspects involved and I haven’t learned much in the past six months. I have to use what I need to read, so I will encounter many problems.
When making bs software, I often find some problems. After solving the problem, I will find that the code I wrote before has left bugs that I never thought of before.
At this time, I had an idea to get rid of all the previous bugs. At this time, the problem came. Some problems were not considered carefully at the beginning, so I just wrote the code directly. If you want to correct it, many places will be affected. You may get dizzy, and if you don't pay attention, you will go back to the previous strange circle.
At this time, I wanted to refactor the entire project code, but another problem arose. The development time required by the product manager was not enough (the function he wanted was expected to be developed in one day, but it actually took me 3 days) , when refactoring code time is more valuable than gold. And the product manager will say every day that it is too slow and needs to be accelerated (the product manager is the company CEO and also my teacher).
Every time this happens, I feel very impetuous and can’t write code with peace of mind. I always think about the bugs in the project.
Let me ask some experts who have the same sentiment as me how to solve this problem.
It is to continue development. After the first version of the product is developed, it is better to develop the second version.
It is better to refactor directly. I personally want to refactor directly so that the program is safer.
You choose a mature PHP framework, such as YII2
, Laravel
, etc., and learn it solidly, so that you can get twice the result with half the effort.
If you are always indecisive, you will only waste your time. Otherwise you will always feel this way:
My personal suggestion is to focus on modularization and divide and conquer when writing code. You might as well consciously try unit testing in the next project. When writing code, try to think about what content may change and what will not change. Is it necessary? Think about encapsulation and whether you should consider the overall framework. I once borrowed a project and completed a mobile UI component library. Although there were many bugs, I did not continue to maintain it. Later, when I wrote the mobile terminal, even if I used other people's frameworks, I felt that it was very smooth because I had to think by myself. After that, you will naturally understand the pain points that framework developers want to solve, and be able to understand some of their ideas, which will be good for the integrity of your code.
Code is never truly perfect. It's just that it's constantly getting closer to perfection. It's good to be able to see the shortcomings of the past, which shows progress.
In fact, it is not just newcomers who encounter this situation. If the project is large enough and the cycle is long enough, as the business volume and complexity of the business increase, it is understandable that the previous model is not suitable.
Unless you can foresee these at the beginning and choose the appropriate model or framework.
However, now that you have encountered this situation, what should you do if you don’t change it and feel uncomfortable? At this time, it is necessary to "gradually renovate" and modify and reconstruct some related codes while making new functions. , after one version iteration is completed, the refactoring you want will be completed.
The above is for reference only.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.
