c++ - Does commenting variables inline with Doxygen come with any penalties? -


i see doxygen docs commenting c++ functions looking akin

/// description of function or method followed comments, /// @return true=success, false=error /// @param[in] bar blah blah /// @param[out] baz blah blah /// @param[out] quux blah blah /// @param[out] quuux blah blah /// @param[out] quuuux blah blah static bool foo_one( int *bar, int *baz, int *quux, int *quuux, int *quuuux ); 

or xml equivalent (roughly)

/// description of function or method, followed /// <returns>true=success, false=error</returns> /// <param name=bar>blah blah</param> /// <param name=baz>blah blah</param> /// <param name=quux>blah blah</param> /// <param name=quuux>blah blah</param> /// <param name=quuuux>blah blah</param> static bool foo_two( int *bar, int *baz, int *quux, int *quuux, int *quuuux ); 

but i've been commenting parameters inline, so

/// description of function or method, followed /// @return true=success, false=error static bool foo_three(     int *bar,               ///< [in]  blah blah     int *baz,               ///< [out] blah blah     int *quux,              ///< [out] blah blah     int *quuux,             ///< [out] blah blah     int *quuuux             ///< [out] blah blah ); 

all 3 of these give identical output in html file (with exception of middle one, doesn't specify in/out).

my question: there features of doxygen, visual studio, or other environment won't able utilize inline approach? understand there personal preferences when writing , reading comments in code , prefer not debate those. i'm interest in know if there doxygen or other environment features or formatting i'll missing out on.

yes.

doxygen work fine inline comments.

however, consider effect on history recorded source code control system (for example, git, , git blame)

with inline comments, last person changed line whoever added or changed documentation, makes harder find when / why code changed.

with comments on separate lines, if documentation added after code, inspecting history find code changes easier.


Comments