Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP2universalStack: universal
namingreadabilityclean-code
Name functions for what they actually do
Pick a name that reflects the function's real behavior; if it slugifies for URLs call it that, if it normalizes inconsistent inputs into one stable value name it for that — avoid vague or misleading names.
PR: hegnar-zephr-components · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codets
| 1 | // turns '', 'null', undefined, false into null |
| 2 | function normalizeString(v) { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // name reflects intent: coerce missing/empty values to null |
| 2 | function toNullableString(v) { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)