forked from extern/naming-cheatsheet
Adds "English language" section
This commit is contained in:
17
README.md
17
README.md
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
# Naming cheatsheet
|
# Naming cheatsheet
|
||||||
|
|
||||||
|
- [English language](#english-language)
|
||||||
- [Naming convention](#naming-convention)
|
- [Naming convention](#naming-convention)
|
||||||
- [S-I-D](#s-i-d)
|
- [S-I-D](#s-i-d)
|
||||||
- [Avoid contractions](#avoid-contractions)
|
- [Avoid contractions](#avoid-contractions)
|
||||||
@ -24,6 +25,22 @@ Naming things is hard. This sheet attempts to make it easier.
|
|||||||
|
|
||||||
Although these suggestions can be applied to any programming language, I will use JavaScript to illustrate them in practice.
|
Although these suggestions can be applied to any programming language, I will use JavaScript to illustrate them in practice.
|
||||||
|
|
||||||
|
## English language
|
||||||
|
|
||||||
|
Use English language when naming your variables and functions.
|
||||||
|
|
||||||
|
```js
|
||||||
|
/* Bad */
|
||||||
|
const primerNombre = 'Gustavo'
|
||||||
|
const amigos = ['Kate', 'John']
|
||||||
|
|
||||||
|
/* Good */
|
||||||
|
const firstName = 'Gustavo'
|
||||||
|
const friends = ['Kate', 'John']
|
||||||
|
```
|
||||||
|
|
||||||
|
> Like it or not, English is the dominant language in programming: the syntax of all programming languages is written in English, as well as countless documentations and educational materials. By writing your code in English you dramatically increase its cohesiveness.
|
||||||
|
|
||||||
## Naming convention
|
## Naming convention
|
||||||
|
|
||||||
Pick **one** naming convention and follow it. It may be `camelCase`, or `snake_case`, or anyhow else, it does not matter. What matters is for it to remain consistent.
|
Pick **one** naming convention and follow it. It may be `camelCase`, or `snake_case`, or anyhow else, it does not matter. What matters is for it to remain consistent.
|
||||||
|
Reference in New Issue
Block a user