How do you do how good maintenance?
The standard answer for this problem may not, because there are many concepts involved, and the face is very wide.
Since there is some part of the work I am engaged in someone else's code maintenance, I said that my opinion
1. First of all, there is a good frame, maybe I don't understand what is a frame now.
For example, your program needs to go to a list, but the operation involved is operated by two threads, then your data needs to be locked.
If you have these data frequently accessed: int Number, int ID, int name; the operation involved is also an impact on these data, it is recommended that you write it into a structure.
In terms of big aspect: If you want to consider your design, the operations and data involved, and the form of data access, and the need to be overloaded.
I saw a program:
For (i = 0; i For (j = 0; j M_List [i] [j] = new cmylistbox; I personally felt that this code brought a lot of trouble to the work of maintenance. If you can write new cmylistbox [Wight] will be much better, because in your delivery process, if the reference is used, It is easy to release the memory in memory, and it is difficult to find this problem when you have launched it. 2. Should write more write functions There is a sentence, I agree, the more you can control your procedures. If you maintain a variable, you will be very troubleself. If you can write a function of a function, the test of a functional function is also very convenient for you, and this is also a way of C language. (At least a functional block test) 3. Small things are capable of replacing the function, if it is a big thing, including data and operations. C gives us, use classes. But if the class is better, the package is better than the dynamic library. If your program is released, you can do not change your interface, but only need to change the dynamic library. It seems that you don't have to compile :) 4. The writing of the program, I hope to have my own way. But there should be a way to understand, at least to understand the author, function, and time, if the algorithm is more complicated, please explain it. 5. Writing of variables. Although the naming of variables is very casual, I hope to refer to a good way. such as Bool m_bplay; and bool m_play; or bool m_flag; meaning to explain the use of variables Today, I have a meal, depressed, misunderstort, thank you!