Skip to content

Commit 9453946

Browse files
committed
Further patterns
1 parent 1e0c191 commit 9453946

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

documentation/conventions-patterns-anti-patterns.djot

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
Gleam enforces `snake_case` for variables, constants, and functions, and
44
`PascalCase` for types and variants.
55

6-
### Acronyms are single words
6+
### Use singular for module names
7+
8+
TODO
9+
10+
### Treat acronyms as single words
711

812
Acronyms are always written as if they were a single word.
913

@@ -64,7 +68,7 @@ pub fn date_to_string(date: Date) -> String
6468
pub fn date_to_rfc3339(date: Date) -> String
6569
```
6670

67-
If there is a more descriptive name for the conversion operation then use that
71+
If there is a more descriptive name ggfor the conversion operation then use that
6872
instead.
6973

7074
```gleam
@@ -75,18 +79,64 @@ pub fn round(data: Float) -> Int
7579
pub fn float_to_int(data: Float) -> Int
7680
```
7781

82+
### Monadic function naming
83+
84+
TODO
85+
7886
## Patterns
7987

8088
### Comment liberally
8189

90+
TODO
91+
8292
### Replace bools with custom types
8393

84-
### Sans-io
94+
TODO
95+
96+
### Sans-io libraries
97+
98+
TODO
99+
100+
### Large modules
101+
102+
TODO
85103

86104
## Anti-patterns
87105

106+
### Panicking in libraries
107+
108+
TODO
109+
88110
### Check-then-assert
89111

112+
TODO
113+
90114
### Global namespace pollution
91115

116+
TODO
117+
92118
### Namespace trespassing
119+
120+
TODO
121+
122+
### Using dynamic with FFI
123+
124+
TODO
125+
126+
## OTP anti-patterns
127+
128+
### Processes as state
129+
130+
TODO
131+
132+
### Unsupervised processes
133+
134+
TODO
135+
136+
### Large messages
137+
138+
TODO
139+
140+
### Organising code with processes
141+
142+
TODO

0 commit comments

Comments
 (0)