Choose identifier names that clearly reveal their purpose and behavior. Names should be specific, descriptive, and self-explanatory: - **Function names** should include verbs that indicate the action being performed or a question being answered (e.g., use `is_consistent()` rather than `consistency()`)
Choose identifier names that clearly reveal their purpose and behavior. Names should be specific, descriptive, and self-explanatory:
is_consistent()
rather than consistency()
)VersionString
is better than generic VersionParser
)Avoid vague or overly generic names that don’t communicate their specific role. When reviewing code, ask “Does this name clearly explain what it does or represents?”
Example:
# Less clear:
def contains_ungroupable(node):
# Implementation...
# More clear:
def contains_gemm_like(node):
# Implementation...
This naming approach reduces cognitive load for readers and makes code more maintainable over time by making its purpose immediately evident.
Enter the URL of a public GitHub repository