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