Skip to content

Commit f55da86

Browse files
authored
Merge pull request #17 from keis/patch-1
Drop plural from count variable
2 parents 6558fc8 + aa3ee7d commit f55da86

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ const pages_count = 5
5151
const shouldUpdate = true
5252

5353
/* Good */
54-
const pagesCount = 5
54+
const pageCount = 5
5555
const shouldUpdate = true
5656

5757
/* Good as well */
58-
const pages_count = 5
58+
const page_count = 5
5959
const should_update = true
6060
```
6161

@@ -70,13 +70,13 @@ A name must be _short_, _intuitive_ and _descriptive_:
7070
```js
7171
/* Bad */
7272
const a = 5 // "a" could mean anything
73-
const isPaginatable = postsCount > 10 // "Paginatable" sounds extremely unnatural
74-
const shouldPaginatize = postsCount > 10 // Made up verbs are so much fun!
73+
const isPaginatable = a > 10 // "Paginatable" sounds extremely unnatural
74+
const shouldPaginatize = a > 10 // Made up verbs are so much fun!
7575

7676
/* Good */
77-
const postsCount = 5
78-
const hasPagination = postsCount > 10
79-
const shouldDisplayPagination = postsCount > 10 // alternatively
77+
const postCount = 5
78+
const hasPagination = postCount > 10
79+
const shouldDisplayPagination = postCount > 10 // alternatively
8080
```
8181

8282
## Avoid contractions
@@ -111,11 +111,11 @@ A name should reflect the expected result.
111111

112112
```jsx
113113
/* Bad */
114-
const isEnabled = itemsCount > 3
114+
const isEnabled = itemCount > 3
115115
return <Button disabled={!isEnabled} />
116116

117117
/* Good */
118-
const isDisabled = itemsCount <= 3
118+
const isDisabled = itemCount <= 3
119119
return <Button disabled={isDisabled} />
120120
```
121121

@@ -154,7 +154,7 @@ The verb part of your function name. The most important part responsible for des
154154
Accesses data immediately (i.e. shorthand getter of internal data).
155155

156156
```js
157-
function getFruitsCount() {
157+
function getFruitCount() {
158158
return this.fruits.length
159159
}
160160
```

0 commit comments

Comments
 (0)