Use naming that is (1) safe per language rules, (2) semantically explicit, and (3) consistent with existing symbol families.
Practical checklist:
_[A-Z] (rename instead).check_time can represent multiple checks, use a precise prefix that states what it tracks (e.g., last_cron_check_time, client_last_cron_check_time, etc.).scanHashTable, scanListpack, then a new counterpart should follow the same scan* pattern (e.g., scanIntSet when applicable). For cluster constants, align names with the established CLUSTER_* scheme (e.g., rename GETSLOT_CROSSSLOT → CLUSTER_CROSSSLOT).Example:
// Bad: reserved pattern in C11
REDISMODULE_API void (*_RedisModule_FreeString)(RedisModuleCtx *ctx, RedisModuleString *str);
// Good: renamed to a non-reserved identifier
REDISMODULE_API void (*RedisModule_FreeString_raw)(RedisModuleCtx *ctx, RedisModuleString *str);
// Good: semantic clarity via explicit prefix
// struct client { mstime_t last_cron_check_time; }
// Good: naming family consistency
void scanIntSet(client *c, robj *o, scanOptions *opts);
// Good: cluster constant consistency
#define CLUSTER_CROSSSLOT (-2)
Enter the URL of a public GitHub repository