- String.IsNullOrEmpty method is used instead of if (stringVariable == null stringVariable == "")
- No unused private method, private variables, parameters in the function
- static variables are initialized when it declared.
- lock(staticvariable) is used before modifying the values in the static variable to avoid concurrency issues.
- No system exception is thrown in the functions. For e.g. never ever throw, throw new Exception();
- General exceptions (Sytem.Exception) are not catched and the specific exceptions are handled.
- cultureInfo (atleast System.Globalization.CultureInfo.CurrentCulture) is passed in the ToString() methods.
- IDisposable is correctly implemented.
- No empty finalizer (constructors)
- Variables are not initialized with its own default values (for e.g, bool b = false, MyClass object = null) which will be handled by the .net runtime.
- There is no unused local variables in the functions.
- The same object is not casted multiple times in the same method. (For e.g. when you DataContext to bind an object, developer might quite frequently cast the DataContext object in a method)
- Methods not using the member variable or instance methods, are declared as static.
- Properties are not returning array (If so, it should be corrected to use Collections)
- Enum declaration contains atleast one '0' value (None)
- No Empty Class and Interfaces used. If empty interfaces need to differentiate the object type (some times!!!), then use attributes.
- Exceptions are not re-thrown, instead only throw is used
- Classes are correctly suffixed (for e.g. Exception (customer exception class), Attribute (custom attribute class), EventArgs, Stream etc..)
- Obviously the naming conventions as you already aware :)
- No infinite thread situation in recursive methods (implement watch dog applications)
Code Review
As a senior member you may have to review your peers code quite often. You may have a check list also with you. Here I compiled a list to enable to you to cross check with your list. You may want revert to me if anything needed additonaly to this list :)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment