-
Notifications
You must be signed in to change notification settings - Fork 16
Coding guidelines
Bob edited this page Jun 25, 2020
·
2 revisions
These are a coding guidelines for the project, when in doubt, consult the Microsoft naming guidelines for anything not included in this list:
Do note these are all guidelines, and not strictly rules. These guidelines do not cover every single case, and in some cases deviation from the guidelines is acceptable.
- Use PascalCasing for classes, structs, methods, properties, events and enums
- Use camelCasing for fields, parameters and local variables
- Use full worlds instead of abbreviations
- Use method names that describe what the method does
- Do not use Hungarian notation
- Do not use underscores in variable names
- Minimize amount of comments, often comments can be replaced by proper method / variable names
- When referencing a type in a method name, use the CLR type name over aliases
- When using a CLR type as a variable type use the alias instead of the CLR type
- Use namespaces that correspond to directories
- Use PascalCase for namespaces
Classes should be written in the following order:
- public propreties
- private properties
- private fields
- constructor
- public methods
- delegates & events