Names should be semantically meaningful and consistent across related concepts in the codebase. This applies to variables, functions, components, and types. When naming:
Names should be semantically meaningful and consistent across related concepts in the codebase. This applies to variables, functions, components, and types. When naming:
Example of poor naming consistency:
// Inconsistent naming pattern
interface User {
customer_id: string; // Uses _id suffix
group: string; // Missing _id suffix
}
function enableStreaminOption() {} // Misspelled, unclear verb
Improved version:
// Consistent naming pattern
interface User {
customerId: string; // Consistent camelCase
groupId: string; // Consistent naming pattern
}
function createStreamingOption() {} // Clear verb, correct spelling
This helps maintain code readability and reduces cognitive load when working across different parts of the codebase.
Enter the URL of a public GitHub repository