DOL Coding Guidelines - Dawn-of-Light/DOLSharp GitHub Wiki
These guidelines serve to improve readability, maintainability and standardization.
-
Capitalize classes, methods and properties (
PascalCase). Members start with lower case (camelCase). -
Prefix interfaces with an
I(i.e.IInterface) -
Do not prefix members (i.e. with
m_)
-
Make
ifeither a single line or surround the body by bracesif (condition) methodCall();or
if (condition) { methodCall(); } -
Use comments only if absolutely necessary. Use descriptive names instead.
- Do not use doc comments for anything else than a public interface and even there it is not mandatory
- Do not explain what a method does when a method name change would do
- Do use comments to explain non-obvious workarounds, algorithms or optimizations
- Do not use abbreviations except for very common ones like
DBorID
- use 4 spaces for each indentation (only for new code!)
-
Names can be longer the narrower the scope.
Examples for almost no restrictions in terms of name length are temporary variables and test method names