doc/coding_style.dox
author deba
Fri, 03 Mar 2006 12:35:32 +0000
changeset 1996 5dc13b93f8b4
parent 1083 8043b93e5973
child 2157 f9171bfc7ebb
permissions -rw-r--r--
Some documentation arrangement modification
     1 /*!
     2 
     3 \page coding_style LEMON Coding Style 
     4 
     5 \section naming_conv Naming Conventions
     6 
     7 In order to make development easier we have made some conventions
     8 according to coding style. These include names of types, classes,
     9 functions, variables, constants and exceptions. If these conventions
    10 are met in one's code then it is easier to read and maintain
    11 it. Please comply with these conventions if you want to contribute
    12 developing LEMON library.
    13 
    14 \warning In some cases we diverge from these rules.
    15 This primary done because STL uses different naming convention and
    16 in certain cases
    17 it is beneficial to provide STL compatible interface.
    18 
    19 \subsection cs-files File Names
    20 
    21 The header file names should look like the following.
    22 
    23 \code
    24 header_file.h
    25 \endcode
    26 
    27 Note that all standard LEMON headers are located in the \c lemon subdirectory,
    28 so you should include them from C++ source like this:
    29 
    30 \code
    31 #include <lemon/header_file.h>
    32 \endcode
    33 
    34 The source code files use the same style and they have '.cc' extension.
    35 
    36 \code
    37 source_code.cc
    38 \endcode
    39 
    40 \subsection cs-class Classes and other types
    41 
    42 The name of a class or any type should look like the following.
    43 
    44 \code
    45 AllWordsCapitalizedWithoutUnderscores 
    46 \endcode
    47 
    48 \subsection cs-func Methods and other functions
    49 
    50 The name of a function should look like the following.
    51 
    52 \code
    53 firstWordLowerCaseRestCapitalizedWithoutUnderscores 
    54 \endcode
    55 
    56 \subsection cs-funcs Constants, Macros
    57 
    58 The names of constants and macros should look like the following.
    59 
    60 \code
    61 ALL_UPPER_CASE_WITH_UNDERSCORES 
    62 \endcode
    63 
    64 \subsection cs-loc-var Class and instance member variables, auto variables 
    65 
    66 The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following.
    67 
    68 \code
    69 all_lower_case_with_underscores 
    70 \endcode
    71 
    72 \subsection cs-excep Exceptions
    73 
    74 When writing exceptions please comply the following naming conventions.
    75 
    76 \code
    77 ClassNameEndsWithException
    78 \endcode
    79 
    80 or
    81 
    82 \code
    83 ClassNameEndsWithError
    84 \endcode
    85 
    86 \section header-template Template Header File
    87 
    88 Each LEMON header file should look like this:
    89 
    90 \include template.h
    91 
    92 */