Write code like painting

Source: Internet
Author: User

I did not write code for a long time and found that the habit of writing code has changed. In the past, a class (or function) was basically written, tested and passed, and another class was written. As for how the two interact, we should first consider clearly, that is, design and UML diagram. At least the write function should be used first. In the future, users should be fully considered in various use cases. Just like painting on a blank sheet of paper, the first painting is always very difficult, so it is often the most boring, and the process of writing code is also very slow. Now it's different. You don't have to worry about the details, so you can start to write code. First, I wrote the code framework. When I thought about it, I wrote down the code first. If there are no specific details, I used pseudocode, text instructions, or incomplete code to give a general impression. In this way, the framework of several related classes (functions) is outlined in the east and west. Although compilation is still not successful, I have gained a better understanding of the entire structure, and the details are constantly becoming clearer and then filled. The details here are determined, and so on. In this way, all the pseudo code or incomplete code becomes real code. After all the blanks are filled in, you can compile F5. At this time, the compiler will also find some errors, continue to fix until the compilation passes. Finally, run debugging until the expected results are obtained.

 

As a result, when painting, we will first use a few simple strokes to outline the outline, and then constantly add details. At the beginning, I couldn't see what it was, but as the details continued to join, they became more and more vivid. You can't say that when you draw a portrait of a person, first draw every hair, then draw the eyes and draw the nose ...... of course, you will first outline the position of the starting shape, eyes, and nose, and then repeat them back and forth. Each time, you will try to ensure that all parts are in the same degree of detail, it cannot be said that the hair is very delicate and the eyes are very crude. I don't know about painting, but I think this is an attempt to ensure coordination and a sense of view. The masters in the movie always draw a few pieces of ink on the paper at will at the beginning, or even the ink on the paper at will, and then add the ink here and the ink there, A vivid painting was born and amazing. Another painting method is printing. The paper enters from one end and comes out from the other. The screen is drawn in a row, and the details are completed at one time.

 

The difference between hand-Painting and printing is that you do not need to consider the details before hand-painting, as long as there is a rough outline and ideas in the chest, the details can be continuously supplemented in the painting process. For printing, we need to take all the details into account at the beginning, and complete the details at the beginning. If the details are not taken into account at the beginning, the printed results cannot be recovered. Hand-drawn images can be balanced by adding more details, because they focus on the whole, not a part. In addition, because the details are constantly added, there is still time to remedy errors. However, if the design drawing (that is, the draft) is good, printing can achieve better results. Therefore, hand-painting is flexible. Printing ensures the quality.

 

Think about it. Isn't agile development and waterfall development exactly the same as hand-drawn and printed?

Related Article

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.