Prefer identifier names that encode the real intent and lifecycle semantics, and keep names consistent across the codebase.
Apply these rules:
ClientName), reuse it rather than inventing near-duplicates.true/false.Example (boolean → explicit state):
type LoadOrigin = 'userInitiated' | 'background';
function load(refresh: boolean, origin: LoadOrigin) {
if (origin === 'background') {
// background checks
}
// ...
}
Example (telemetry contract):
captureCheckpointUsage(ulid, action, durationMs); // ensure callers pass ulid, not taskId
This improves searchability, reduces misinterpretation, and prevents subtle contract breaks caused by naming drift.