Skip to content

Coding standards

JasonOffutt edited this page Apr 30, 2013 · 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

  • Other C# "Spacing" Settings

    Check both 'Insert space within argument list parenthesis' optionsCheck both 'Insert space within argument list parenthesis' options

    three other spacing optionsthree other spacing options

    four more spacing for delimiter optionsfour more spacing for delimiter options

  • 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.

Tip: Use the keyboard shortcut Ctrl-Shift-D for quickest usage.

Git Branching

Read the Git Branching Strategy page to follow our branching standard convention.

JavaScript Best Practices

Read the JavaScript Coding Standards page to get up to speed on what we like to see on the front-end.

Clone this wiki locally