Reconstruction Chapter 2 reconstruction principles

Source: Internet
Author: User

1. What is refactoring?
Reconstruction (TERM): an adjustment to the internal structure of the software. The purpose is to improve the comprehensibility and reduce the modification cost without changing the [suspicious behavior of the software.
Refactoring (verb): uses a series of refactoring principles (techniques) to adjust the structure without changing [software-aware Behavior.
Two hats: Add new features and refactor

2. Why rebuild
Improve the software design to organize and modify the code structure to eliminate repeated code (duplicate code)
Make the software easier to understand
Helping you find bugs
Helping you increase programming speed

3. When to refactor

1) when the three rules do something for the first time, they only do it. If they do something similar for the second time, they will dislike it, but they do it anyway. The third time they do something similar, you should refactor it.
Three strikes and you refactor)

2) added functions and restructured them together.

3) rebuild together with fixing errors

4) Review the code and refactor it together

5. Difficult Reconstruction
Database
Modify the interface (do not release the interface too early. Please modify your code ownership policy to make refactoring smoother)
Time should not be restructured (the code is too messy, and it is better to rewrite a rebuild; the project is near the deadline and there is no time, but it should have been re-built long ago)
6. refactoring and Performance
8. Reconstruction Origin

 

I have not carefully read the following sections.

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.