Prompt
Names should be clear, descriptive and follow consistent patterns. Choose names that accurately reflect the purpose and behavior of the code element:
- Use semantic prefixes/suffixes that match established patterns:
- State flags should use consistent prefixes (e.g.,
isActivatednotdeactive) - Type names should start with uppercase (e.g.,
PluginParamnotpluginParam) - Internal implementations should use descriptive suffixes (e.g.,
ComputedRefImplnot_ComputedRef)
- State flags should use consistent prefixes (e.g.,
- Pick clear, unambiguous names that convey intent:
- Prefer descriptive names over abbreviated ones (e.g.,
immediateoverrunOnce) - Use complete words rather than shortened forms
- Follow framework conventions (e.g.,
VNodeKeyoverVKey)
- Prefer descriptive names over abbreviated ones (e.g.,
Example:
// Bad
class _ComputedRef {
isDeactive: boolean
runOnce: boolean
}
// Good
class ComputedRefImpl {
isActivated: boolean
immediate: boolean
}