How to write a good article on source code analysis

hello

(1) Read the program code and let the mental method be used by me.

(2) Understand the structure, and you can easily grasp the whole picture.

(3) With high-quality tools in hand, it is not difficult to understand the program.

(4) Look at the meaning of the text, and then weigh the role of the ingredients.

(5) Find the entrance of the program and start from top to bottom.

(6) The pleasure of reading, knowing the author through the program code.

Read other people's program code (1)-read the program code so that I can use all my methods.

The program code was written by others, and only the original author really understands the purpose and significance of the program code. Many programmers have an unconscious fear of being forced to touch the program code written by others. However, instead of refusing to accept other people's program code, it is better to thoroughly understand the relevant language and practices as the cornerstone of cultivating self-strength.

For most programmers, writing code may be a pleasure, but I believe that more people regard reading other people's code as a daunting thing. Many people would rather rewrite their own program code than accept other people's program code and then correct, maintain and even enhance their functions.

What's the key to this? If you hit the nail on the head, it's actually very simple. The program code was written by others, and only the original author really understands the purpose and significance of the program code. Many programmers have an unconscious fear of being forced to touch the program code written by others. This comes from the primitive fear of strange things in the depths of human hearts.

Looking at other people's program code will make you gain a lot.

However, for many practical reasons, programmers are often forced to accept other people's program codes. For example, if a colleague leaves his job, he must take over the job he left behind. It is also possible that you are a rookie who just entered the department, and your colleagues have enough experience, so you will be promoted. The wind and water turn, and a new generation of rookies will become rookies. Even, the project undertaken by your company must take over or integrate the system left by the customer's previous manufacturer, and you only have the source code of that system (with luck, the number of documents is different).

Stories like this are actually constantly being staged around or on programmers. Many programmers will take it as a tragedy to take over other people's code. Everyone doesn't want to take over the code written by others, because they don't want to spend time exploring, and they would rather spend their productivity on generating new code than understanding it.

Unfortunately, the above situation is inevitable for programmers. We always have to touch the program code written by others, and even have to understand it and modify it. For this demand, in today's open source code atmosphere, as mentioned in the previous article "Programming 2.0", you can learn new technologies and master architecture design through open source code, which greatly improves the efficiency and effect of learning. You can even extract directly from open source projects, extract the program code you need, stand on the shoulders of giants, and get the required productivity directly from the other side. From this point of view, understanding the program code written by others is no longer just "forced acceptance" from a negative point of view, but "drawing nutrition", which has great positive value.

Understand the system architecture and behavior pattern first, and then read it carefully.

If writing program code is one of the important skills of programmers, then reading other people's program code and then modifying it is bound to be another important skill.

Satisfied, please adopt.