The timing and essentials of code refactoring

Source: Internet
Author: User

The result of code refactoring is critical
For programmers, the meaning of refactoring does not seem to require much, and the clean code that is universally acknowledged is better.
In a non-programmer-led project, refactoring requires more responsibility for the results, and once the refactoring brings more bugs and delay to the schedule, the refactoring itself is suspected, and the kick and the tease are only between the lines.

the time to refactor
The best time is the task closing phase: The child task ends up cleaning up the child task's code, and the big task ends up cleaning up the large task's code.
There are several reasons for this:
-Test resources: Once a part of the code after the QA test, the cost of its own increased (programmer +qa Input), if the refactoring occurs after the QA test, then the QA test resources are wasted, the game on-line after doing, there is more waste
-Familiarity with code: At the end of the day, it is the best time to remember, refactoring will be particularly efficient, of course, there may be different ideas over time, but this and based on the familiar part is not the same thing
-After cleaning up the code, for the implementation of things, there will be the best clarity, the heart will feel more practical and refreshing
In general, it is very reasonable to do cleanup at the end of a task, and if it is pulled out separately as a task, it will be compared with other tasks to prioritize, and if the code runs without problems, the refactoring priority comparison is often downwind, Even if the programmer himself is afraid to make a choice of non-refactoring at this time.

the meaning of refactoring
For the project to be needless to say, long-term observation of the most serious damage is the programmer itself.
Refactoring itself seems to be a process of cultivation, calm down to the writing of things to re-organize, if reflection.
Gradually will develop good code habits, see their shortcomings and then learn to grow, and then become accustomed to the first version to write good code.
Without refactoring, you lose valuable reflective learning opportunities, accustomed to writing messy code this will be very dangerous, later want to change over, I am afraid it will be a long time.
and the ability to write concise code is a very important ability to do large projects, the number one challenge for large projects is complexity.

The timing and essentials of code refactoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.