Bian Que went to see Wang one day, and the two started a conversation.
Wang: I heard that both of your brothers are medical practitioners. who have the highest medical skills?
Flat: I think my eldest brother has the highest medical skill, and the people think that I have the highest medical skill.
Wang: This ...... Why?
Flat: Let's just say, dawang. The eldest brother can find that the disease is unknown to people, and his diet can be noticed with a little attention, but the patient does not know that he is treating the disease, so he is not famous. The second brother can find the disease in the early stage, and can cure it with a prescription, the people thought that he could only cure minor illness, so he was very famous. I had to take care of serious illness, put blood with a knife, and the people who were ill would treat me as a doctor. Where do they know, my eldest brother is a real medical doctor who is unaware of people and makes people suffer less.
If the code is patient, the programmer is a doctor, who are the three brothers of Bian Que?
Martin Fowler first visited the project and proposed adjustment of class structure behavior. The Project Manager delayed the adjustment due to the progress pressure. He also refused the author's efforts to sort out the internal core, because refactoring does not introduce any new features, it just makes the Code look good, but the project fails six months later.
What is refactoring?
The so-called refactoring is a process in which code is modified without changing the external behavior of the Code to improve the internal structure of the program. Refactoring is a disciplined, trained, and methodically organized method that minimizes the chance of accidentally introducing errors throughout the process. In essence, refactoring is to improve its design after the code is written.
Refactoring is equally important to design, even in the face of poor design.
The importance of the design before the code is self-evident. It is a good habit to design and code first, but it still cannot avoid the deterioration of the code quality, especially when the amount of code is constantly increasing and people involved in the project change, A piece of cutting-and-cutting, the face may have been completely different, the Code slowly rotten, the end of the world, the project building is not broken.
Through refactoring, you can find the balance between changes. You will find that the so-called design is no longer a prerequisite for all actions, but gradually emerges throughout the development process. In the process of building a system, you can learn how to enhance the design, and the interaction that comes with it allows a program to maintain a good design in the development process.