Back to all reviewers

Semantic over generic names

netty/netty
Based on 9 comments
Java

Choose specific, descriptive names that clearly convey purpose over generic or abbreviated identifiers. Names should be self-documenting and unambiguous about their role.

Naming Conventions Java

Reviewer Prompt

Choose specific, descriptive names that clearly convey purpose over generic or abbreviated identifiers. Names should be self-documenting and unambiguous about their role.

Key guidelines:

  • Replace generic terms with specific ones (e.g., ‘type’ → ‘ordering’)
  • Avoid abbreviations unless universally understood
  • Use complete words that describe the variable’s purpose
  • Ensure names reflect the actual functionality

Example:

// Problematic - generic, unclear names
private int num;
private boolean type;
private String content;

// Better - specific, descriptive names
private int componentCount;
private boolean lastInFirstOutOrdering;
private String contentHeaderValue;

This practice improves code readability, reduces the need for additional documentation, and helps prevent misunderstandings during maintenance. When choosing names, consider whether another developer could understand the purpose without additional context.

9
Comments Analyzed
Java
Primary Language
Naming Conventions
Category

Source Discussions