Code Review

Our team is reading the code Magiccode group, on the whole writing code compliant, the structure is very reasonable. Each class each method in doing their own thing. Variables are defined at the local close, no unpalatable very confusing code appears. However, some of which still fly in the ointment, here are some of my personal opinion:

1. There is no comment. To the code, the entire text without a comment, to my understanding caused a lot of obstacles, but I believe that maintenance after they also cause some trouble.

2. The code is written in line with specifications, but the style is not very uniform, I began to suspect just a matter of personal habit. But later they found the same before and after the sentence is not the same, do not know what the intention. See FIG first and second comparison FIG below, and a third in FIG. 4 and FIG.

3. In some places, writing is not precise enough, such as the following is not taking into account the untapped.

4. There are some places, purely personal opinion, presented here, to hear your views. For example, the following example, the individual feels "to first determine there is no List, abuse feel a little thrown," but some people feel that the following wording better.

5. still have some questions, do not understand, as in the following example of why the word == null situation will happen, occur, is it not a waste of space.

Of course, look at the code is rewarding, such as:

The following example, a single bond pattern, so that there will only be a global SearchManager instance, the constructor will be closed, only a method for external GetInstance acquired unique instance variables. Previously seen in other places, used here is very good.

Reproduced in: https: //www.cnblogs.com/buaashine/archive/2012/12/13/2815630.html

Guess you like

Origin blog.csdn.net/weixin_34219944/article/details/94548467