Subversion Repositories gelsvn

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 136
Line 13... Line 13...
13
 
13
 
14
Nothing that imposes too much work should be made a coding
14
Nothing that imposes too much work should be made a coding
15
convention. For instance, a standard comment before each function
15
convention. For instance, a standard comment before each function
16
definition sounds like a good idea, but even with a template, it is
16
definition sounds like a good idea, but even with a template, it is
17
cumbersome to add and maintain these chunks of text, so I choose to
17
cumbersome to add and maintain these chunks of text, so I choose to
18
omit them.
18
omit them. However, Doxygen comments are added whereever I get around to it.
19
 
19
 
20
The philosophy behind the conventions below is that they should simply 
20
The philosophy behind the conventions below is that they should simply 
21
be standard ways of doing what a programmer does anyway and that they
21
be standard ways of doing what a programmer does anyway and that they
22
should add only very little extra work.
22
should add only very little extra work.
23
 
23
 
Line 29... Line 29...
29
 
29
 
30
* Names of constants are all uppercase letters. Underscores are used to
30
* Names of constants are all uppercase letters. Underscores are used to
31
combine words, e.g. `MAX_LEVEL'
31
combine words, e.g. `MAX_LEVEL'
32
 
32
 
33
* Names of classes and other new types are in lower case but
33
* Names of classes and other new types are in lower case but
34
inter-capitalized, e.g. `class BoneMachine'
34
inter-capitalized, e.g. `class MyClass'
35
 
35
 
36
* The names of functions are lower case. Words are combined with
36
* The names of functions are lower case. Words are combined with
37
underscores, e.g. `int get_max()'
37
underscores, e.g. `int get_max()'
38
 
38
 
39
FUNCTION NAMING
39
FUNCTION NAMING
Line 106... Line 106...
106
* The name of the header file is that of the class + `.h'
106
* The name of the header file is that of the class + `.h'
107
 
107
 
108
* All non-auxiliary classes with one or more functions that are not
108
* All non-auxiliary classes with one or more functions that are not
109
inline have a definition file of their own.
109
inline have a definition file of their own.
110
 
110
 
111
* The name of the definition file is that of the class + `.cc'
111
* The name of the definition file is that of the class + `.cpp'
112
 
112
 
113
* The #define <macro> in the include guard uses the name of the file -
113
* The #define <macro> in the include guard uses the name of the
-
 
114
  namespace followed by the name of the file - capitalized and with dot
114
 capitalized and with dot replaced by underscore. The macro name is
115
  replaced by underscore.	This string is also preceeded and followed by
115
preceded by two underscores
116
	two underscores. For instance,
116
 
117
 
117
E.g.
-
 
118
 
-
 
119
#ifndef __BONEMACHINE_H
118
#ifndef __CGLA__ARITHVECFLOAT_H__
120
#define __BONEMACHINE_H
119
#define __CGLA__ARITHVECFLOAT_H__
121
 
120
 
122
... code ....
121
... code ....
123
 
122
 
124
#endif
123
#endif
125
 
124
 
-
 
125
  Not all code adheres to this convention yet.
-
 
126