aboutsummaryrefslogtreecommitdiff
path: root/notes/lookalike_idents.txt
blob: c70b7065ba34c729aa63b8aca4976569bb600196 (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

Lookalike identifiers
=====================

Should look-alike identifiers be considered conflicting?

E.g. `admin` and `adnin`?

Perhaps normalize like this:

    i_ -> L
    l  -> i
    n  -> m
    rn -> m
    I  -> i
    I_ -> L
    0  -> O
    1  -> i
    1_ -> L
    2  -> Z
    5  -> S

But there needs to be a special case for single-letter variables
(or segments of names), e.g.:

    m       n
    m0      n0
    arr_m   arr_n
    arr_m0  arr_n0
    

Maybe also (but these break hexadecimal numbers!):

    c1 -> d
    6  -> b
    8 -> B

And perhaps forbid the following

    __  (double underscore)