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
namingmethodsreadabilityclean-code
Name methods descriptively; reserve generic get for accessor semantics
Avoid a bare get() for methods that compute/derive data; a name like getArticleRenderData communicates intent, and get() conventionally implies a keyed/array/singleton accessor.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetypescript
| 1 | class ArticleBox { |
| 2 | get() { return this.data.map(toRenderShape); } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | class ArticleBox { |
| 2 | getRenderData(): ArticleRenderData[] { return this.data.map(toRenderShape); } |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)