This document is based on the work of
B. Weinberger, C. Silverstein,
G. Eitzmann, M. Mentovai
and T.Landray
at http://google-styleguide.googlecode.com,
C++ Google Style guide, Revision 3.274
under the CC-By 3.0 License
Each style point has a summary for which additional information is available by toggling the accompanying arrow button that looks this way:
. You may toggle all summaries with the big arrow button:Though a pain to write, comments are absolutely vital to keeping our code readable. The following rules describe what you should comment and where. But remember: while comments are very important, the best code is self-documenting. Giving sensible names to types and variables is much better than using obscure names that you must then explain through comments.
When writing your comments, write for your audience: the next contributor who will need to understand your code. Be generous — the next one may be you!
/// ... text ... /// ... text ...
///
syntax for the comments going in the
Web documentation, the //
syntax for explicative
comments in the code and the /* */
syntax only for
the comments within one line.
class
keyword.
namespace
keyword.
[1] Doxygen [http://www.doxygen.org]