Writing Good Comments
// Good (Comments)
Function Level Comments
/*
* @brief Short description of the function
*
* Extended description goes here. This should explain any semantic issues that
* may arise when using the function. Below are descriptions of the function
* parameters. The value in the brackets can be either `in` or `out`, and
* represent the direction in which the parameter goes-- for example, the `dest`
* argument for `memcpy` would be `out`, while the `src` and `n` arguments would
* be `in`. Also note that grouped descriptions should be avoided unless the
* grouped parameters are intrinsically linked-- for example, (x,y,z)
* coordinates.
*
* @param[out] param0_name param0 description
* @param[in] param1_name param1 description
* @param arg2,arg3,arg4 description of the multiple args
*
* @return Description of the return value goes here. This can be omitted if the
* return type is `void`. This command will end when it reaches a
* blank line.
*/Inline Implementation Comments
Notes to Other Developers (Or Yourself)
Teams Contributed to this Article:
Last updated
Was this helpful?
