blob: cffd732401a1940d32b79874aff1837d1938153e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
Identifier styles in aptitude.
These are not followed 100%, but should generally be used for new
code.
1) Capitalization
Class names:
class some_class_name
{
};
Template parameters:
template<typename TemplateParam1, typename TemplateParam2>
class foo { ... };
template<typename Key, typename Val>
class my_super_map { ... };
Note that single-character names are not used. They should only be
used if the type is truly unimportant, such as in a container:
template<typename T>
class my_super_list { ... };
Member variables and member functions:
class foo
{
int some_member_variable;
};
In some parts of aptitude, camelCase creeps in here; it is
acceptable for new code, but dispreferred.
Macros:
#define MY_MACRO
2) Accessors
For value classes, aptitude follows the get_NAME() pattern to retrieve
the value of the property NAME. If there is a corresponding mutator,
use set_NAME(), but normally immutable objects are preferred.
|