Back to all reviewers

Consistent naming standards

pola-rs/polars
Based on 3 comments
Python

Maintain consistent and standardized naming throughout the codebase: 1. **Use snake_case for multi-word identifiers**: Separate words in variable names, function names, and parameters with underscores.

Naming Conventions Python

Reviewer Prompt

Maintain consistent and standardized naming throughout the codebase:

  1. Use snake_case for multi-word identifiers: Separate words in variable names, function names, and parameters with underscores.

  2. Be consistent with identifier names: Use the same name for a concept throughout function signatures, implementations, and documentation.

  3. Choose descriptive, semantic names: Select names that clearly reflect the purpose and context of the identifier. More specific names improve code clarity and maintainability.

Example:

# Incorrect
def filter(self, predicate: Expr, *, use_abspath: bool = False) -> Series:
    """
    Filter elements by expr
    """
    # implementation using expr

# Correct
def filter(self, predicate: Expr, *, use_abs_path: bool = False) -> Series:
    """
    Filter elements by predicate
    """
    # implementation using predicate
    
# More descriptive naming
MaintainOrderJoin: TypeAlias = Literal["none", "left", "right", "left_right", "right_left"]

Consistent naming reduces cognitive load, improves code readability, and helps prevent bugs that could arise from naming confusion.

3
Comments Analyzed
Python
Primary Language
Naming Conventions
Category

Source Discussions