"Refactoring-improving the design of existing code" generalization

Source: Internet
Author: User
Objective

Refactoring (Refactoring) is a process that modifies code to improve the internal structure of the program without altering the external behavior of the code. Refactoring is a disciplined and methodical process of organizing, which minimizes the chance of introducing errors in the process of finishing. 1th Chapter Reconstruction, the first case (slightly)
2nd Chapter Reconstruction Principle

What is refactoring:

Refactoring (noun): an adjustment to the internal structure of a software to improve its understanding and reduce its cost of modification without changing the behavior of the software observable.

Refactoring (verb): The use of a series of refactoring techniques, without changing the software observable behavior, under the premise of adjusting its internal structure.

The contrast with refactoring is performance optimization. As with refactoring, performance tuning typically does not change the behavior of the component (in addition to the speed of execution) and only changes its internal structure. But the two starting points are different, performance optimization often makes the code more difficult to understand, but in order to get the required performance has to do so. (Performance optimization in order to get the desired performance, have to do a bit of sacrifice, such as adding additional data structure, business logic complexity. Software reconfiguration is to improve the understanding of software, reduce its maintenance costs, the purpose of the software design structure of the internal adjustment, if the refactoring deviated from these two purposes, then should be enough. )

Why refactoring:

Reconstruction and improvement of software design

• Refactoring makes software easier to understand

L Refactoring Help Find bugs

L Refactoring improves programming speed

(The higher the understanding of the internal design structure of the software, the easier it is to see the design defects and improve the programming speed)

When to refactor:

L refactoring when adding functionality

L Refactoring when patching errors

L refactoring when code is reviewed

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.