Skip to content

Commit 4a57f1d

Browse files
committed
Adds table of contents
1 parent 96dea1d commit 4a57f1d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
# Naming cheatsheet
88

9+
- [Naming convention](#naming-convention)
10+
- [S-I-D](#s-i-d)
11+
- [Avoid contractions](#avoid-contractions)
12+
- [Avoid context duplication](#avoid-context-duplication)
13+
- [Reflect expected result](#reflect-expected-result)
14+
- Naming functions
15+
- [A/HC/LC pattern](#ahclc-pattern)
16+
- [Actions](#actions)
17+
- [Context](#context)
18+
- [Prefixes](#prefixes)
19+
- [Singular and Plurals](#singular-and-plurals)
20+
21+
---
22+
923
Naming things is hard. This sheet attempts to make it easier.
1024

1125
Although these suggestions can be applied to any programming language, I will use JavaScript to illustrate them in practice.
@@ -250,7 +264,7 @@ function getRecentPosts(posts) {
250264

251265
> Some language-specific assumptions may allow omitting the context. For example, in JavaScript, it's common that `filter` operates on Array. Adding explicit `filterArray` would be unnecessary.
252266
253-
---
267+
--
254268

255269
## Prefixes
256270

@@ -322,7 +336,7 @@ function fetchPosts() {
322336
}
323337
```
324338

325-
## Singular/Plurals
339+
## Singular and Plurals
326340

327341
Like a prefix, variable names can be made singular or plural depending on whether they hold a single value or multiple values.
328342

0 commit comments

Comments
 (0)