File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,31 @@ function isClientActive(client) {
260
260
```
261
261
** [ ⬆ back to top] ( #table-of-contents ) **
262
262
263
+ ### Function names should say what they do
264
+
265
+ ** Bad:**
266
+ ``` javascript
267
+ function dateAdd (date , month ) {
268
+ // ...
269
+ }
270
+
271
+ let date = new Date ();
272
+
273
+ // It's hard to to tell from the function name what is added
274
+ dateAdd (date, 1 );
275
+ ```
276
+
277
+ ** Good** :
278
+ ``` javascript
279
+ function dateAddMonth (date , month ) {
280
+ // ...
281
+ }
282
+
283
+ let date = new Date ();
284
+ dateAddMonth (date, 1 );
285
+ ```
286
+ ** [ ⬆ back to top] ( #table-of-contents ) **
287
+
263
288
### Remove duplicate code
264
289
Never ever, ever, under any circumstance, have duplicate code. There's no reason
265
290
for it and it's quite possibly the worst sin you can commit as a professional
You can’t perform that action at this time.
0 commit comments