Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- [English language](#english-language)
- [Naming convention](#naming-convention)
- [Time/Duration naming convention](#timeduration-naming-convention)
- [S-I-D](#s-i-d)
- [Avoid contractions](#avoid-contractions)
- [Avoid context duplication](#avoid-context-duplication)
Expand Down Expand Up @@ -59,6 +60,23 @@ const page_count = 5
const should_update = true
```

## Time/Duration naming convention

Name your variables with **units**. For timestamps, if not using a native date/timestamp type, be sure to have something like `seconds` or `ns`.

```js
/* Bad */
const startAt = Date.now()
const delay = 5

/* Good */
const startAtUnixMilliseconds = Date.now()
const delaySeconds = 5

/* Good as well */
const start_at_unix_ms = Date.now()
```

## S-I-D

A name must be _short_, _intuitive_ and _descriptive_:
Expand Down