Back to all reviewers

Use universally understandable identifiers

fastapi/fastapi
Based on 2 comments
Python

When naming variables, functions, routes, and other code elements, use clear, neutral terminology that will be understood by all developers regardless of their cultural or domain-specific knowledge. This is especially important in tests, examples, and documentation where context may not be obvious.

Naming Conventions Python

Reviewer Prompt

When naming variables, functions, routes, and other code elements, use clear, neutral terminology that will be understood by all developers regardless of their cultural or domain-specific knowledge. This is especially important in tests, examples, and documentation where context may not be obvious.

For test names, use descriptive identifiers that clearly indicate what’s being tested, including test conditions and parameters:

# Less clear:
def test_create_item():
    # ...

# More clear:
def test_create_item_when_separate_input_output_schemas_is():
    # ...

For route paths and other public-facing code, prefer neutral, generic terms over domain-specific or culturally-bound terminology:

# Potentially confusing:
@app.get("/pita/shuli")
def get_pita_shuli():
    # ...

# Clearer for all developers:
@app.get("/category/item")
def get_category_item():
    # ...

Clear naming reduces the cognitive load for all developers interacting with the codebase, especially those who are new to the project or from different cultural backgrounds.

2
Comments Analyzed
Python
Primary Language
Naming Conventions
Category

Source Discussions