X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Doc%2FWebsite%2FCodingStyle.html;h=1b0eb06fad83f94b7a94e6027161cd811e7fd997;hb=e362e154b84f087750d1ed1f6671a34b3bf5ff7a;hp=784ab04306904c4c079a1b67d69eab1a64c893a7;hpb=e1e4959f7c4aaacb90fc1ce89a99675011b8d938;p=gdcm.git diff --git a/Doc/Website/CodingStyle.html b/Doc/Website/CodingStyle.html index 784ab043..1b0eb06f 100644 --- a/Doc/Website/CodingStyle.html +++ b/Doc/Website/CodingStyle.html @@ -48,9 +48,9 @@ * Naming conventions: - Generalities: - In general, names are constructued by using case change to indicate + In general, names are constructed by using case change to indicate separate words, as in ImageDataSize (standing for "image data size"). - Underscores are not used. Variable names are chosen carefully with the + Underscores are not used. Variable names are choosen carefully with the intention to convey the meaning behind the code. Names are generally spelled out; use of abbreviations is discouraged. [Note: abbreviation are allowable when in common use, and should be in @@ -71,7 +71,11 @@ Local variables begin in lowercase. There is more flexibility in the naming of local variables although they still should convey some semantics. - + - Naming function parameters: + Function parameters begin in lowercase. There is more flexibility in the + naming of function parameters although they still should convey some + semantics. + * Classes: - Don't use the inline keyword when defining an inline function within a class definition. @@ -84,6 +88,11 @@ { GroupPixel = groupPixel; } + - Don't use trailing ';' in inline function definition. + use : + void A::SetGroupPixel( int groupPixel ){GroupPixel = groupPixel;} + NOT + void A::SetGroupPixel( int groupPixel ){GroupPixel = groupPixel;}; - Do not repeat the virtual keyword when overriding virtual base methods in declaration of subclasses: class A @@ -189,7 +198,7 @@ The Doxygen open-source system is used to generate on-line documentation. Doxygen requires the embedding of simple comments in the code which is in turn extracted and formatted into documentation. See - http://www.stack.nl/ dimitri/doxygen/ + http://www.stack.nl/~dimitri/doxygen/ for more information about Doxygen. - Documenting a class: Classes should be documented using the class and brief doxygen commands, @@ -212,7 +221,7 @@ bool Readable = false; /// \brief The number of lines of the image as interpreted from - /// the various elements encountered at header parsing. + /// the various elements encountered at header parsing. int NumberOfLines = -1; /// Predicate implemented as accessor around \ref Readable. @@ -256,7 +265,7 @@ and not T* foo = 0; nor - T * foo; + T * foo = 0; - Assume T is a given type. When declaring or defining with the "reference to T" notation, the & character must be adjacent to the variable and not the type. That is use :