Skip to content

DOL Coding Guidelines

NetDwarf edited this page Feb 18, 2023 · 1 revision

These guidelines serve to improve readability, maintainability and standardization.

Mandatory

  • 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 braces
    if (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 or ID

Highly Recommended

  • use 4 spaces for each indentation (only for new code!)

Rule of Thumb

  • 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