domains / / JetBrains/kotlin
Names express clear intent
Choose names that clearly express intent and follow established conventions. Prefer explicit, descriptive names over abbreviations or ambiguous terms. Align with platform-specific naming patterns and maintain consistency with existing codebase conventions.
Choose names that clearly express intent and follow established conventions. Prefer explicit, descriptive names over abbreviations or ambiguous terms. Align with platform-specific naming patterns and maintain consistency with existing codebase conventions.
Key guidelines:
- Use full descriptive names instead of abbreviations (e.g.,
BREADTH_FIRSToverBFS) - Follow platform naming conventions (e.g.,
reifiedTypeParametersfor properties,getReifiedTypeParameters()for functions in Kotlin) - Choose names that accurately reflect the variable’s purpose (e.g.,
argumentTypeinstead oftypeArgument) - Avoid terms that conflict with language keywords or have special meaning (e.g., use
childinstead ofinner) - Maintain consistency with similar names in the codebase
Example:
// Incorrect
enum class WalkAlgorithm {
BFS, // Abbreviated
DFS // Abbreviated
}
// Correct
enum class WalkAlgorithm {
BREADTH_FIRST, // Explicit
DEPTH_FIRST // Explicit
}