Code review is in progress-you know!

Source: Internet
Author: User
Data API and background data synchronization have been completed. I did not care about this part in about two days. Code Mainly because the products and bosses are not very active. Because this is not very important after all. Today, I reviewed the code and made some repairs, such as naming conventions and code logic, and made the code more compliant with the specifications of the entire framework (such as file classification, specifies the file to do what it should do ). So I had the urge to write a blog post "Code Review", so I had this article. Staring at the whistle Program Personnel should know the importance of code review. I believe many programmers do not like code review. Do you like code review? For more than two years, the company has been repairing code and adding functions based on the original code. This will inevitably lead to frequent access to other people's code and naturally develop the habit of code review. During code review, I often feel that I am always staring at me when I feel like someone (haha, usually the boss. Are I lazy? Do I fully understand the logic? What code do I write? Do I code according to naming conventions? Have I written beautiful and perfect code ?...

Now, every time I write the code, I will read the Old Code at intervals. If I find something bad, I will fix it (this should be code review ). I am a phper. I don't like to use tools to review this. I like to use my eyes and my mind to think about it. Some people have said that you are not standard and inefficient. -- Haha, after all, I think my workload is not big, so I have been coding review for a lot of time. Every time I look at my code, I look at a piece of art. I often ask myself, are I satisfied with the code I write? What are the disadvantages? Can I write better?

I feel that code review is a wonderful process, which makes my head clearer from chaos. At the beginning, I will have a headache, but as you review constantly, the entire idea becomes clearer and the code becomes more and more standardized. The human brain is a very strange thing. Chaos to clarity is a painful and pleasant process. If you do not go through this process for a long time, your head will easily become rusty. So what is chaos like? I like my nephew's sentence, "it's like a pile of paste in my head." He compared this chaos to a paste. I believe that when you clean the paste, your head will be clear. Let's look at another unpleasant metaphor, just like the feeling that you excluded the stool from your stomach. The more stool, the better it will feel after being discharged. Therefore, the more you can't understand in your code, the more comfortable your mind will be and the whole body will be very easy.

How do I code review? Early stage: I first find a starting point (maybe a page, maybe a regular execution script main () method), and then find classes one by one, find methods until the final output. -- Constantly handle this process. And then find the next entry point. Later Stage: I will select a few common services that are not clearly understood, and then look for the starting point for the above loop.

Recommendation

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.