aboutsummaryrefslogtreecommitdiff
path: root/notes/class_naming_enums_ints.txt
blob: 368c1929f0d3ed3bc9ffb3e4bf082166f4483eeb (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

Perhaps use a naming convention to distinguish between enums and ints?
(I think this is most likely a bad idea, but I'm keeping this for future
reference.)

+ Makes it possible to see what is what even at the usage site
+ Simple solution
- Needs special case for `Bool` (and `Byte`?)
- Needs to handle numbers at the end (for example `Int32` or "V2" of stuff)
- A bit inflexible, for example `LineWrapMode` (enum) vs `VideoMode` (struct)

Syntax 1, using embedded suffixes:

    # Enums: Ending with "Kind" or are called "Bool"
    # Should other suffixes be allowed as well?
    # Such as "Mode"? But then that would conflict with "VideoMode".
    ExprKind
    ExprKind2   # version 2
    # Integers: Ending with "Int"
    Int32
    OneDigitInt
    TinyInt

Syntax 2, using embedded prefixes (a bit like C# does for interfaces):

    # Enums: Starting with "E" and a capital letter or digit
    EExpr
    # Integers: Starting with "I" and a capital letter or digit
    I32
    IOneDigit # but this would be confusing for C# programmers

Syntax 3, using separate prefixes (a bit like C's struct/union/enum tags):

    enum ExprKind
    enum ExprKind2
    int I32
    int OneDigitInt
    int TinyInt

Syntax 4, using sigills:

    &ExprKind
    &ExprKind2
    %Int32
    %OneDigitInt
    %TinyInt