You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,10 @@ getUser();
68
68
**[⬆ back to top](#table-of-contents)**
69
69
70
70
### Use searchable names
71
-
We will read more code than we will ever write. It's important that the code we do write is readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable.
71
+
We will read more code than we will ever write. It's important that the code we
72
+
do write is readable and searchable. By *not* naming variables that end up
73
+
being meaningful for understanding our program, we hurt our readers.
74
+
Make your names searchable.
72
75
73
76
**Bad:**
74
77
```javascript
@@ -88,6 +91,23 @@ for (var i = 0; i < MINUTES_IN_A_YEAR; i++) {
88
91
```
89
92
**[⬆ back to top](#table-of-contents)**
90
93
94
+
### Use explanatory variables
95
+
**Bad:**
96
+
```javascript
97
+
let cityStateRegex =/^(.+)[,\\s]+(.+?)\s*(\d{5})?$/;
0 commit comments