- Magic numbers
- Constants with a specific meaning should be clearly named
- Possible exceptions include:
0
,1
and2
where usage is unambiguous- arguably the shift and mask values when doing bitshifting and masking
- Single-letter variables names
- With the possible exceptions of:
x
andy
for coordinates- maybe
i
andj
for loop counters
- With the possible exceptions of:
- Using contractions in variable names
- E.g.
cnt
forcount
,idx
forindex
- E.g.
- Using
+
to combine bitmasks instead of|
- Mixing brace styles
- Mixing tabs and spaces for indentation
- Using tabs for indentation and spaces for alignment is perfectly acceptable, though whether you should be aligning your code is more contentious
Created
October 11, 2019 02:06
-
-
Save Pharap/8658f64266a65b2741fdb3c9841f1997 to your computer and use it in GitHub Desktop.
A list of so-called 'programming sins'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment