Choose names that clearly communicate intent without requiring mental gymnastics to understand. Avoid double negatives in variable names, maintain consistent naming patterns across the codebase, and ensure names accurately describe their purpose and context.
Choose names that clearly communicate intent without requiring mental gymnastics to understand. Avoid double negatives in variable names, maintain consistent naming patterns across the codebase, and ensure names accurately describe their purpose and context.
Key principles:
pythonNoGlobalHandlers requiring !pythonNoGlobalHandlers, use positive naming like legacyGlobalHandlersnodeCompatHttpServerHandler instead of generic registerFetchEvents)Module as a parameter name throughout the codebase, stick with it consistently, or rename the type to ModuleType to allow lowercase module parametersExample of improvement:
// Avoid - requires double negative
export const pythonNoGlobalHandlers: boolean = !!compatibilityFlags.python_no_global_handlers;
if (!pythonNoGlobalHandlers) { ... }
// Prefer - clear positive naming
export const legacyGlobalHandlers: boolean = !compatibilityFlags.python_no_global_handlers;
if (legacyGlobalHandlers) { ... }
Enter the URL of a public GitHub repository