-
Notifications
You must be signed in to change notification settings - Fork 37
Coding standards
alastairs edited this page Dec 4, 2011
·
2 revisions
To help code maintainability and readability StyleCop will be used to enforce a few rules. Currently all projects are using the one setting file found in the src directory. A ReSharper settings file provides development-time assistance in conforming to the GiveCRM coding standards.
Always include curly braces (this means you can't miss out curly braces on single line if blocks)
Unnecessary code must be removed.
- Access modifiers must be declared
- Fields must be private
- Code analysis suppression must have justification
-
Debug.Assert
s must provide a text message -
Debug.Fail
must provide a text message
- Interface names must begin with an I
- Const field names must begin with an upper case letter
- Field names must not use Hungarian notation
- Field names must begin with a lower case letter
- Variable names must not be prefixed (no putting _ or m_ infront of them)
- Field names must not begin with an underscore
const
s must appear before fields.
- Comments must contain text
- Don't use
region
s - Code must not contain empty statements
- Use
string.Empty
not""