-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVariableNaming.txt
More file actions
48 lines (41 loc) · 1.49 KB
/
Copy pathVariableNaming.txt
File metadata and controls
48 lines (41 loc) · 1.49 KB
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
47
48
Keep all variables Pascal Case
Prefix >>>
1st Char is the Scope and Upper Case:
L = Local
F = Function Parameter
M = Module (of a class)
S = Static
G = Global (do not use)
2nd Char is the Variable Type and Lower Case:
o = object
s = string
n = numeric
b = bool
e = enum
m = map
v = vector/deque/list/array/etc
f = function/lambda/bind/etc
x = template object
Examples:
LvDates = Locally scoped list of dates
MsDates = Class module that is a string of dates (probably CSV string)
FbDate = A function parameter that is a boolean to use a date
SmDates = A Static object of mapped dates
LoDate = A locally referenced date object
FxDate = A function param that is a template of Date types
template<typename T> auto Function(const xvector<T>& FvDates);
Suffix
* If it is a pointer type, then end it with Ptr
* Example = auto LoDate = RA::MakeShared<Date>();
* Any time you have a pointer, always use the GET macro
* GET(LoDate) // then use the generated reference.
* The GET macro will throw an exception if the pointer is null
* Always have functions wrapped in Begin()/Rescue() macros for handling
* Return a ref (instead of ptr), if the Ptr is a part of the class
void Function(xp<RA::Date> FoDatePtr)
{
Begin();
GET(FoDate);
// -- do something useful -- //
Rescue();
}