Back to all reviewers

Use semantically clear names

gravitational/teleport
Based on 3 comments
Other

Choose names that clearly convey their purpose, scope, and meaning to reduce ambiguity and improve code maintainability. Avoid generic or potentially confusing terms when more specific alternatives exist.

Naming Conventions Other

Reviewer Prompt

Choose names that clearly convey their purpose, scope, and meaning to reduce ambiguity and improve code maintainability. Avoid generic or potentially confusing terms when more specific alternatives exist.

Key principles:

  • Replace ambiguous terms with more specific ones that accurately reflect the item’s role
  • Consider the broader context where the name will be used
  • Use industry-standard terminology when available
  • Add qualifying words to distinguish between similar concepts

Examples:

// Instead of generic 'role' which could mean many things
string role = 4;

// Use specific 'system_role' to clarify the type of role
string system_role = 4;
// Instead of 'node_name' which implies SSH nodes only
string node_name = 3;

// Use 'friendly_name' or 'host_name' to reflect broader applicability
string friendly_name = 3;
// Instead of "App to App" which is less common
title: App to App mTLS

// Use "Service to Service" which aligns with industry terminology
title: Service to Service mTLS

This practice prevents confusion during code reviews, reduces onboarding time for new developers, and makes the codebase more self-documenting.

3
Comments Analyzed
Other
Primary Language
Naming Conventions
Category

Source Discussions