doc/coding_style.dox
author marci
Mon, 20 Sep 2004 16:20:11 +0000
changeset 889 47bb9b8f5705
parent 667 9cba4444d804
child 921 818510fa3d99
permissions -rw-r--r--
EXAMPLE_PATH is set to the demo dir.
alpar@507
     1
/*!
alpar@507
     2
alpar@509
     3
\page coding_style Hugo Coding Style 
alpar@507
     4
alpar@811
     5
\section naming_conv Naming Conventions
alpar@507
     6
alpar@667
     7
In order to make development easier we have made some conventions
alpar@667
     8
according to coding style. These include names of types, classes,
alpar@667
     9
functions, variables, constants and exceptions. If these conventions
alpar@667
    10
are met in one's code then it is easier to read and maintain
alpar@667
    11
it. Please comply with these conventions if you want to contribute
alpar@667
    12
developing Hugo library.
athos@603
    13
alpar@614
    14
\subsection cs-class Classes and other types
athos@603
    15
athos@603
    16
The name of a class or any type should look like the following:
alpar@507
    17
alpar@507
    18
\code
alpar@507
    19
AllWordsCapitalizedWithoutUnderscores 
alpar@507
    20
\endcode
alpar@507
    21
alpar@614
    22
\subsection cs-func Methods and other functions
athos@603
    23
athos@603
    24
The name of a function should look like the following:
alpar@507
    25
alpar@507
    26
\code
alpar@507
    27
firstWordLowerCaseRestCapitalizedWithoutUnderscores 
alpar@507
    28
\endcode
alpar@507
    29
alpar@614
    30
\subsection cs-funcs Constants, Macros
athos@603
    31
athos@603
    32
The names of constants and macros should look like the following:
alpar@507
    33
alpar@507
    34
\code
alpar@507
    35
ALL_UPPER_CASE_WITH_UNDERSCORES 
alpar@507
    36
\endcode
alpar@507
    37
alpar@614
    38
\subsection cs-loc-var Class and instance member variables, auto variables 
alpar@507
    39
athos@603
    40
The names of class and instance member variables and auto variables (=variables used locally in methods) should look like the following:
alpar@507
    41
alpar@507
    42
\code
alpar@507
    43
all_lower_case_with_underscores 
alpar@507
    44
\endcode
alpar@507
    45
alpar@614
    46
\subsection cs-excep Exceptions
alpar@507
    47
athos@603
    48
When writing exceptions please comply the following naming conventions:
athos@603
    49
alpar@507
    50
\code
alpar@507
    51
ClassNameEndsWithException
alpar@507
    52
\endcode
alpar@507
    53
alpar@811
    54
\warning In some cases we diverge from these rules.
alpar@811
    55
This primary done because STL uses different naming convention and
alpar@811
    56
in certain cases
alpar@811
    57
it is beneficial to provide STL compatible interface.
alpar@507
    58
alpar@507
    59
*/