Back to all reviewers

Choose domain-specific semantic names

zed-industries/zed
Based on 5 comments
Rust

Names should clearly reflect their domain-specific meaning and purpose, avoiding generic or ambiguous terms. This applies to variables, methods, classes, and other identifiers. When naming, consider:

Naming Conventions Rust

Reviewer Prompt

Names should clearly reflect their domain-specific meaning and purpose, avoiding generic or ambiguous terms. This applies to variables, methods, classes, and other identifiers. When naming, consider:

  1. Use domain terminology that precisely describes the concept
  2. Avoid broad or generic terms that could be ambiguous in the codebase context
  3. Be explicit about the purpose or behavior
  4. Maintain consistency with established domain naming patterns

Example:

// Avoid: Generic or ambiguous names
pub fn tokens(&self) -> &Arc<SemanticTheme> { ... }
let askpass_content = format!(...);

// Better: Domain-specific semantic names
pub fn semantic_tokens(&self) -> &Arc<SemanticTheme> { ... }
let askpass_script = format!(...);

This approach helps maintain clarity and reduces confusion, especially in large codebases where context may not be immediately apparent. When introducing new names, ensure they align with the domain language used throughout the project.

5
Comments Analyzed
Rust
Primary Language
Naming Conventions
Category

Source Discussions