Chapter 1 reconstruction, the first case

Source: Internet
Author: User

How can I start to introduce refactoring? According to the traditional practice, when introducing something, we should first give a rough introduction to its history and main principles. However, whenever someone introduces these things at the venue, it always triggers my sleep worm. My thoughts began to wander, and my eyes began to lag until he or she took out the instance, so that I could not mention the spirit. The reason why an instance can save me is that it allows me to see the real progress of things. It is easy to talk about the principle, and it is difficult to explain how to use it. Providing an example can help me understand things clearly.

So I decided to use an instance as the starting point of this book. In this process, I will tell you a lot about the refactoring principle and make you feel a little bit about the refactoring process. Then I can provide you with an introduction to the principles of common views.

However, in the face of this introductory example, I encountered a big problem. If I select a largeProgramThe description of the program itself and the description of the reconstruction process are too complex for any reader to grasp (I tried it, even a slightly more complex example will go over 100 pages ). If I select a program that is small enough to be easy to understand, I am afraid I cannot see the value of refactoring.

Like anyone who wants to introduce "useful technologies used in the real world", I am in a very typical dilemma. I will show you how to refactor in a small program of my choice, but frankly speaking, the scale of that program is not worth doing. But if I show youCodeAs a part of a large system, refactoring technology will soon become important. So let's take a look at this small example and imagine that it is in a much larger system.

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.