-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBestPractices
52 lines (27 loc) · 1.33 KB
/
BestPractices
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
49
50
51
52
Best Practices:
1): Sanitize variables when ever you can for type safety.
1): Check types when assuming information
2): Sanitize incoming arguments in functions
3): Sanitize io.read() to what you need always
2): Keep "Modules" mostly self contained for their own functionality
1): Keeping "Modules" mostly self contained means
not having more than 1-4 other modules required
2): If you need to include more than 1-4 modules
then your not writing a module your writing a library
3): Exceding the intended use of a module is
bad practice avoid it if at all possible
3): Naming variables
1): Module tables will be lowercase for convienence
2): Constants like PI will be all caps
3): For multiple words you shall use CammelCase
3): Functions:
1): Keep functions relativly simple, if you can
express your function as a psudo code expression
your good
4): Documentation
1): Document every function with "---" notation from the lsp
2): Document "Modules" so that you know what they are used for
3): If your "Module" or "Data Structure" is very complex then
make a graph to show how it works in a high level way
5): File Structure
1):