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).
mobile ruleP2stack specificStack: Kotlin
kotlinreadability
Use named arguments for non-obvious call sites
Pass named arguments when a call has several parameters, booleans, or same-typed values whose meaning isn't obvious from position (DI wiring, constructors, config). Names make the call self-documenting and guard against silently swapping two positional args of the same type.
PR: profico-org-corpus batch2 (all stacks/products)Created: Jul 26, 2026
Bad example
Old codekotlin
| 1 | AppViewModel(get(), get(), true, false) |
Explanation (EN)
The two booleans and injected deps are meaningless at the call site and easy to transpose.
Objašnjenje (HR)
Good example
New codekotlin
| 1 | AppViewModel( |
| 2 | repository = get(), |
| 3 | analytics = get(), |
| 4 | offlineFirst = true, |
| 5 | debug = false, |
| 6 | ) |
Explanation (EN)
Named arguments document each value and prevent accidental swaps.
Objašnjenje (HR)