Skip to content

Commit 94c4bf0

Browse files
committed
Add guideline for naming convention.
1 parent cf7e909 commit 94c4bf0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ A style configuration file is given: [`.clang-format`](.clang-format)
6464

6565
Although the standalone tool `clang-format` may be used, we recommend to integrate the formatting using a [plugin](https://firefox-source-docs.mozilla.org/code-quality/coding-style/format_cpp_code_with_clang-format.html#editor-plugins) for the editor of your choice.
6666

67+
#### Naming convention
68+
69+
For naming symbols in C or C++ we use the following rules to increase uniformity in our code:
70+
71+
- Types: `UpperCamelCase`
72+
- Variables: `lowerCamelCase`
73+
- C preprocessor macros: `MACRO_CASE`
74+
- namespaces: `snail_case`
75+
- Template parameters: `MACRO_CASE`
76+
- Enumerators: `MACRO_CASE`
77+
- Prefix interface classes with a capital `I`
78+
- Do not use Hungarian notation.
79+
- If your file defines mainly one class, consider to name the file after the class.
80+
81+
This shall be a nonbinding guideline and *does not need* to be enforced neither technically nor in manual code reviews.
82+
6783
### Doxygen configuration
6884

6985
If you change [`Doxyfile`](Doxyfile), please do a ['cleanup'](https://stackoverflow.com/questions/71157463/what-part-of-the-doxygen-configuration-doxyfile-is-recommended-for-version-con#comment125783393_71157463) by using the output of `doxygen -x`.

0 commit comments

Comments
 (0)