Names should be descriptive and specific enough to clearly communicate their purpose and avoid confusion. This includes using full words instead of abbreviations, being domain-specific when necessary, and ensuring names accurately reflect the function’s behavior or data’s purpose.
Key guidelines:
isRightToLeftLocale
instead of isRtlLocale
getSentFolderCandidatesByRegex
could be getImapSentFolderCandidatesByRegex
FlatEntityMapsCacheService
vs WorkspaceFlatMapCacheService
stepExecution.result
instead of result.result
useUpdateMultipleRecordsFromManyObjects
instead of useUpdateManyRecordsFromManyObjects
Example:
// ❌ Ambiguous and abbreviated
const isRtlLocale = (locale: string) => { ... }
const mergeInProgressState = atom({ ... })
// ✅ Descriptive and specific
const isRightToLeftLocale = (locale: string) => { ... }
const isMergeInProgress = atom({ ... })
This helps with IDE autocompletion, reduces naming conflicts, and makes code more self-documenting for better maintainability.
Enter the URL of a public GitHub repository