Back to all reviewers

Use specific semantic names

microsoft/vscode
Based on 6 comments
Typescript

Choose specific, descriptive names for identifiers that accurately reflect their purpose and behavior. Avoid generic terms or ambiguous names that could lead to confusion. Names should be self-documenting and convey precise meaning.

Naming Conventions Typescript

Reviewer Prompt

Choose specific, descriptive names for identifiers that accurately reflect their purpose and behavior. Avoid generic terms or ambiguous names that could lead to confusion. Names should be self-documenting and convey precise meaning.

Key guidelines:

  • Add clarifying prefixes/suffixes to distinguish similar concepts
  • Avoid language keywords as identifiers
  • Use names that reflect the exact functionality

Example - Improving name specificity:

// โŒ Ambiguous or generic names
class AiRelatedInformation { }
function isPath(string: string) { }
interface SearchOptions { }

// โœ… Specific, semantic names
class AiSearchSettingKeysProvider { }
function isPathLike(text: string) { }
interface RipgrepTextSearchOptions { }

This helps prevent confusion, makes code more self-documenting, and reduces the need for additional clarifying comments.

6
Comments Analyzed
Typescript
Primary Language
Naming Conventions
Category

Source Discussions