Coding style

The standard Visual Studio built-in C# coding style is recommended to be used.

Recommended styles

Avoid using ambiguous block

Not good:
if (a == b) c = 10;

Good:
if (a == b)
{
  c = 10;
}

Give XML comments for public members

All public members (properties and methods) should be having XML comments.

Debug code consider to use conditional compiling

Some code that may only be used in debug mode, it is recommended to make it surrounded by conditional compiling with DEBUG symbol.
#if DEBUG
  // debug code goings here
#endif

Add comment at end of large code-region

If region become large, or there are several levels of region. It is recommended to add a comment with same name to begin of region, at the end of region.
  #region Saving
  // saving code goings here
  #endregion // Saving

Last edited Jan 31, 2014 at 4:07 PM by unvell, version 9