-
Notifications
You must be signed in to change notification settings - Fork 102
DOL Coding Guidelines
NetDwarf edited this page Feb 18, 2023
·
1 revision
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
if
either 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
DB
orID
- 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
Dawn of Light - DOL Server - http://www.dolserver.net - Wiki Home