Back to all reviewers

Use descriptive names

vadimdemedes/ink
Based on 3 comments
JavaScript

Choose variable, function, and export names that clearly communicate their purpose and content. Avoid abbreviations and ambiguous terms that could mislead other developers about what the identifier represents.

Naming Conventions JavaScript

Reviewer Prompt

Choose variable, function, and export names that clearly communicate their purpose and content. Avoid abbreviations and ambiguous terms that could mislead other developers about what the identifier represents.

Key principles:

  • Variable names should accurately reflect what they contain, not just their general category
  • Avoid abbreviations when full words improve clarity (e.g., previousCounter instead of prevCounter)
  • Export names should be specific enough to understand their purpose (e.g., ProgressBar instead of Bar)

Example of unclear naming:

const subProcess = childProcess.spawn('ping', ['8.8.8.8']).stdout;
// Misleading: subProcess actually contains stdout, not the process

exports.Bar = Bar; // Too ambiguous

Example of clear naming:

const subProcess = childProcess.spawn('ping', ['8.8.8.8']);
const stdout = subProcess.stdout;
// Clear: each variable accurately represents what it contains

exports.ProgressBar = ProgressBar; // Specific and clear

This practice prevents confusion during code reviews and maintenance, making the codebase more self-documenting and easier to understand.

3
Comments Analyzed
JavaScript
Primary Language
Naming Conventions
Category

Source Discussions