Choose variable, function, and type names that clearly communicate their purpose and meaning without requiring additional context or comments. Names should be self-documenting and unambiguous to future developers.
Choose variable, function, and type names that clearly communicate their purpose and meaning without requiring additional context or comments. Names should be self-documenting and unambiguous to future developers.
Replace generic or unclear identifiers with descriptive alternatives:
enableExpandedMcpPanelState
over ambiguous string states like "collapsed" | "expanded"
const CONTEXT_EXPANSION_LINES = 3
instead of hardcoded 3
"claude_message.json"
- use descriptive constants or derive from existing naming conventionsFor complex types, ensure the type structure is self-explanatory:
// Instead of unclear typing
private contextHistoryUpdates: Map<number, [number, Map<number, ContextUpdate[]>]>
// Use descriptive types
private contextHistoryUpdates: Map<number, [EditType, Map<number, ContextUpdate[]>]>
When names become long for clarity, prioritize understanding over brevity. A longer, clear name is preferable to a short, ambiguous one that requires documentation to understand.
Enter the URL of a public GitHub repository