Changes for page Expressive Names
Last modified by chrisby on 2023/11/18 17:45
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -4,7 +4,7 @@ 4 4 * **Avoid misinformation.** For example, ambiguities, confusion with similar names or easily confused characters (l and 1, O and 0). 5 5 * **Make differences clear.** Avoid very similar expressions and blank words are redundant (a, an, the, info, data). 6 6 * **Use pronounceable names.** Programming is a social activity that people talk about with others. 7 -* **Use searchable names. 7 +* **Use searchable names.** Searchable means avoiding search conflicts with other independent things with the same name. The length of a name should match the size of its scope. For local counting loops, one letter is sufficient; if the variable is used in several places in the code, it needs a longer name. 8 8 * **Avoid encodings.** There should be no references to the scope or type of the variable in the name. 9 9 * **Avoid mental mappings.** The name of a variable should not require mental effort to understand. For example, unusual abbreviations should be avoided. 10 10 * **Names of classes consist of nouns** or substantivistic expressions.