Best Tips for documenting code using doxygen? [closed]

You don’t need and should not write the name of the file in the @file directive, doxygen reads the name of the file automatically. The problem with writing the name of the file is that when you rename the file you will have to change the @file directive as well.

Providing @author and @date information is also useless most of the time since the source control system does it a lot better than someone editing the files manually.

You also don’t have to write @brief if you use the following Doxygen syntax and enable JAVADOC_AUTOBRIEF in doxygen’s configuration:

/*! Short Description on the first line

    Detailed description...
    ...
*/
void foo(void) {}

The @name directive for functions is also 100% redundant most of the time and completely useless. It only brings errors when someone modifies the name of the function and not the doxygen @name.

Leave a Comment