... | @@ -57,12 +57,14 @@ This is done to check if the function had an error. |
... | @@ -57,12 +57,14 @@ This is done to check if the function had an error. |
|
It's very easy to forget to call an object's init() method, leaving objects in a undefined state.
|
|
It's very easy to forget to call an object's init() method, leaving objects in a undefined state.
|
|
|
|
|
|
## **Commenting rules**
|
|
## **Commenting rules**
|
|
- **Every function shall be preceded by a doxygen-style comment describing the purpose of the function, its parameters and the return value.**
|
|
- **Every function shall be documented using a doxygen comment describing the purpose of the function, its parameters and the return value.**
|
|
- **Write a comment defining pre and post-conditions for most methods.**
|
|
- **Write a comment defining pre and post-conditions for most methods.**
|
|
This rule is aimed at improving the readability of the code.
|
|
This rule is aimed at improving the readability of the code.
|
|
- **Write a comment describing every variable when its meaning is not trivial**
|
|
- **Write a comment describing every variable when its meaning is not trivial**
|
|
- **Write a comment describing the purpose of each class, struct and enum**
|
|
- **Write a comment describing the purpose of each class, struct and enum**
|
|
|
|
|
|
|
|
For a guide on how to use doxygen to document the code, take a look here: https://www.stack.nl/~dimitri/doxygen/manual/docblocks.html
|
|
|
|
|
|
## **Best practices**
|
|
## **Best practices**
|
|
These rules are mostly aimed at keeping the code readable and consistent.
|
|
These rules are mostly aimed at keeping the code readable and consistent.
|
|
|
|
|
... | | ... | |