Beauty of refactoring-opening part

Source: Internet
Author: User

Code refactoring has become a frequent issue. Since Martin Fowler's book refactoring, it has been around for ten years. Many programmers have become familiar with refactoring. However, whenever we face project pressure, we often leave the reconstruction behind and leave it out of the 9th cloud. There are enough reasons to explain: the function is not complete. Why should we rebuild it? The reason is that we have not considered refactoring as a habit. Even though many ides now support common refactoring Methods automatically, we will still forget and ignore them. Reconstruction cannot directly generate value, because we have not yet seen the beauty of reconstruction.

This column tries to re-launch the reconstruction flag to improve the existingCodeDesign, making restructuring deeply rooted in the hearts of the people, to a "hysterical" advocacy and shouting. Refactoring is not a trivial matter. If everyone can learn to use the tool of refactoring, the developer's living environment may become beautiful. Beautiful code, beautiful structure, and beautiful design are always so pleasing to the eye. We yearn for a beautiful environment, which is the result of nature; so, why cannot we create a beautiful code environment?

How to present the beauty of refactoring? The key is to find ugly and intolerable. Hate for ugliness is actually a powerful driving force that will drive you to use refactoring until it turns into a natural and indispensable breath. Reconstruction can be performed anytime, anywhere, without special stages. Regular refactoring ensures that the code is always updated, such as sharp. The masterpiece of Andy hunt and David Thomas 《ProgramThe path to practice is mentioned in the famous "Broken window theory ". Broken Windows represent poor designs, wrong decisions, or bad code. They think that "don't tolerate broken windows (don't live with broken windows)" and they need to repair it in time. It is also Andy Hunt's book practices of an agile developer. When talking about the good habits of efficient programming, he thinks that "it takes time and effort to keep the code Clean and bright ." Hunt's personal experience is that "in the project, the code should be brilliant, and there should be no darkness ."

Sincerely speaking!

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.