diff --git a/README.md b/README.md index 342f90f..d438f64 100644 --- a/README.md +++ b/README.md @@ -117,9 +117,9 @@ function getUser(): User; **[⬆ back to top](#table-of-contents)** -### Use searchable names +### Use searchable names / Avoid Magic Literals -We will read more code than we will ever write. It's important that the code we do write must be readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable. Tools like [ESLint](https://typescript-eslint.io/) can help identify unnamed constants. +We will read more code than we will ever write. It's important that the code we do write must be readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable. Tools like [ESLint](https://typescript-eslint.io/) can help identify magic literals. **Bad:** @@ -131,7 +131,7 @@ setTimeout(restart, 86400000); **Good:** ```ts -// Declare them as capitalized named constants. +// Declare them as capitalized symbolic constants. const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000; // 86400000 setTimeout(restart, MILLISECONDS_PER_DAY);