Back to all reviewers

Clear consistent identifier names

neondatabase/neon
Based on 7 comments
Rust

Choose clear, consistent, and non-redundant names for identifiers across the codebase. Follow these guidelines: 1. Use specific, descriptive names that clearly indicate purpose:

Naming Conventions Rust

Reviewer Prompt

Choose clear, consistent, and non-redundant names for identifiers across the codebase. Follow these guidelines:

  1. Use specific, descriptive names that clearly indicate purpose:
    // Bad
    type SegmentSize = u32;
       
    // Good
    type WalSegmentSize = u32;  // Clearly indicates this is for WAL segments
    
  2. Maintain consistent naming patterns throughout the codebase:
    // Bad: Mixing naming patterns
    struct PostHogLocalEvaluationFlag {}
    struct LocalEvaluationResponse {}
       
    // Good: Consistent naming
    struct LocalEvaluationFlag {}
    struct LocalEvaluationResponse {}
    
  3. Avoid redundant prefixes when context is clear:
    // Bad: Redundant context
    pub http_client: reqwest::Client  // In HTTP-specific module
       
    // Good: Clean, contextual naming
    pub client: reqwest::Client
    
  4. Use clear, specific variable names in method parameters:
    // Bad: Ambiguous naming
    async fn from_request_parts(_: &mut Parts, state: &Arc<ComputeNode>)
       
    // Good: Clear purpose
    async fn from_request_parts(_: &mut Parts, compute: &Arc<ComputeNode>)
    

This standard helps maintain code readability and reduces confusion during code review and maintenance.

7
Comments Analyzed
Rust
Primary Language
Naming Conventions
Category

Source Discussions