VirtualBox

Changeset 57833 in vbox


Ignore:
Timestamp:
Sep 18, 2015 8:08:10 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
102783
Message:

VBox-CodingGuidelines.cpp: A couple doxygen hints, warning about UTF-8 string sources, officially forbid single and double underscores in symbols (thought everyone knew that).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/VBox-CodingGuidelines.cpp

    r53944 r57833  
    7070 *      - char strings are UTF-8.
    7171 *
     72 *      - Strings from any external source must be treated with utmost care as
     73 *        they do not have to be valid UTF-8.  Only trust internal strings.
     74 *
    7275 *      - All functions return VBox status codes. There are three general
    7376 *        exceptions from this:
     
    9396 *        the platforms.
    9497 *
     98 *      - The use of symbols leading with single or double underscores is
     99 *        forbidden as that intrudes on reserved compiler/system namespace. (3)
     100 *
    95101 *      - All files have file headers with $Id and a file tag which describes
    96102 *        the file in a sentence or two.
    97  *        Note: Remember to enable keyword expansion when adding files to svn.
     103 *        Note: Use the svn-ps.cmd/svn-ps.sh utility with the -a option to add
     104 *              new sources with keyword expansion and exporting correctly
     105 *              configured.
    98106 *
    99107 *      - All public functions are fully documented in Doxygen style using the
     
    102110 *
    103111 *      - All structures in header files are described, including all their
    104  *        members.
    105  *
    106  *      - All modules have a documentation 'page' in the main source file which
    107  *        describes the intent and actual implementation.
     112 *        members. (Doxygen style, of course.)
     113 *
     114 *      - All modules have a documentation '\@page' in the main source file
     115 *        which describes the intent and actual implementation.
    108116 *
    109117 *      - Code which is doing things that are not immediately comprehensible
     
    116124 *
    117125 *      - Comments on \#else indicates what begins while the comment on a
    118  *        \#endif indicates what ended.
     126 *        \#endif indicates what ended.  Only add these when there are more than
     127 *        a few lines (6-10) of \#ifdef'ed code, otherwise they're just clutter.
    119128 *
    120129 *
     
    127136 *     __declspect(export) constructs are the main reason for this.
    128137 *     OTOH, we do perhaps have a bit too detailed graining of this in VMM...
     138 *
     139 * (3) There are guys out there grepping public sources for symbols leading with
     140 *     single and double underscores as well as gotos and other things
     141 *     considered bad practice.  They'll post statistics on how bad our sources
     142 *     are on some mailing list, forum or similar.
    129143 *
    130144 *
     
    274288 *        from typemap-shared.inc.xsl every few KB of output, or xsltproc will
    275289 *        end up wasting all the time reallocating the output buffer.
     290 *
     291 *
     292 * @subsection sec_vbox_guideline_compulsory_doxygen    Doxygen Comments
     293 *
     294 * As mentioned above, we shall use doxygen/javadoc style commenting of public
     295 * functions, typedefs, classes and such.  It is preferred to use this style in
     296 * as many places as possible.
     297 *
     298 * A couple of hints on how to best write doxygen comments:
     299 *
     300 *      - A good class, method, function, structure or enum doxygen comment
     301 *        starts with a one line sentence giving a brief description of the
     302 *        item.  Details comes in a new paragraph (after blank line).
     303 *
     304 *      - Except for list generators like \@todo, \@cfgm, \@gcfgm and others,
     305 *        all doxygen comments are related to things in the code.  So, for
     306 *        instance you DO NOT add a doxygen \@note comment in the middle of a
     307 *        because you've got something important to note, you add a normal
     308 *        comment like 'Note! blah, very importan blah!'
     309 *
     310 *      - We do NOT use TODO/XXX/BUGBUG or similar markers in the code to flag
     311 *        things needing fixing later, we always use \@todo doxygen comments.
     312 *
     313 *      - There is no colon after the \@todo.  And it is ALWAYS in a doxygen
     314 *        comment.
     315 *
     316 *      - The \@retval tag is used to explain status codes a method/function may
     317 *        returns.  It is not used to describe output parameters, that is done
     318 *        using the \@param or \@param[out] tag.
     319 *
     320 * See https://www.stack.nl/~dimitri/doxygen/manual/index.html for the official
     321 * doxygen documention.
    276322 *
    277323 *
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette