Skip to content

Coding standards

mikepetersonccv edited this page Oct 10, 2012 · 9 revisions

The following are the adopted coding standards:

  • First and foremost, follow the established patterns you see in the existing code base. Don’t invent your own patterns!

  • See http://www.dotnetspider.com/tutorials/CodingStandards.doc

  • Follow items 1 through 11 in section 7. Naming Conventions and Standards.

  • Regarding TAB vs Spaces, use 4 spaces instead of a tab. In Visual Studio, under Tools->Options, Text Editor, C#, Tabs, set your Tab size and Indent size to 4 and radio option to "Insert spaces".

    Tab Settings

  • Use the Organize Usings | Remove and Sort tool when editing your cs files. Sort them putting 'System' directives first. Turn this option on in Visual Studio, under Tools->Options, Text Editor, C#, Advanced, and enable "Place 'System' directives first when sorting usings"

    Tab Settings

  • Use GhostDoc

    Download GhostDoc from http://submain.com/download/ghostdoc/. Enter your email address and click "Download GhostDoc". Just use the default settings when installing. Now that it is installed, use it to document methods, classes, properties, etc. It is OK to just leave the default comments that it generates. At a minimum, it is nice to get rid of the compiler warnings due to wrong or missing XML comments.

Clone this wiki locally