Meaningful and Descriptive Names * Choose names carefully, as if naming a child. * Names should reflect the code's purpose clearly. For example, use unorderedNumbers and orderedNumbers instead of a generic numbers. 1.
Avoid Misinformation * Steer clear of ambiguous, easily confused names or characters (e.g., l vs. 1, O vs. 0). 1.
Clarity in Differences * Distinguish names distinctly, avoiding similar expressions and redundant words (e.g., a, an, the, info, data). 1.
Pronounceable and Searchable Names * Use names that are easy to pronounce and discuss. * Name length should match its scope: short for local loops, longer for broader usage. 1.
No Encodings or Mental Mappings * Avoid including type or scope information in names. * Names should be clear without requiring mental translation. 1.
Naming Conventions for Classes and Methods * Class names: Use nouns or noun phrases. * Method names: Use verbs or verb phrases, adhering to standards like JavaBean (get, set, is, has). Utilize descriptive function names instead of overloaded constructors. 1.
Avoid Inappropriate Humor and Ambiguities * Refrain from humorous names. * Choose one word per concept to maintain consistency (e.g., always use "get" instead of alternating with "fetch" or "retrieve"). * Avoid puns and ambiguous terms (like "add" for addition or appending). 1.
Domain-Specific Naming * Use technical terms (solution domain) for clarity among programmers. * Use terms from the problem domain when no technical equivalents exist, aiding domain experts. 1.
Context and Simplicity in Naming * Provide meaningful context through combined variable and method names. * Avoid unnecessary context; opt for shorter, meaningful names. * Be open to renaming for clarity and improvement.