Prompt
Choose names that clearly and unambiguously describe their purpose rather than being overly generic or technical. Names should be self-documenting and immediately convey what the entity does or represents.
Key principles:
- Prefer descriptive names over generic ones:
MAX_ANIMATION_DURATIONinstead ofANIMATION_TIMEOUT - Choose contextual names for user-facing types:
IgnoreUnknownPropsinstead ofDeepStripStringIndexUnknown - Method names should clearly indicate behavior:
trackClassesinstead ofaddClasses(which implies DOM manipulation) - Follow the philosophy: “choose the shortest name that unambiguously and meaningfully describes a thing”
Examples:
// ❌ Generic or misleading names
const ANIMATION_TIMEOUT = 4000;
export type DeepStripStringIndexUnknown<T> = ...;
addClasses(details: AnimationDetails, classes: string[]): void;
// ✅ Descriptive and clear names
const MAX_ANIMATION_DURATION = 4000;
export type IgnoreUnknownProps<T> = ...;
trackClasses(details: AnimationDetails, classes: string[]): void;
Avoid names that could confuse developers about the actual functionality. When in doubt, err on the side of being more descriptive rather than more concise.