Why this matters
Reduces copy-paste and keeps behavior consistent.
Factor common interaction/message handling into reusable functions or classes with parameters for the differing bits.
Reduces copy-paste and keeps behavior consistent.
Side-by-side examples engineers can pattern-match during review.
fun onLike(){ /* parse, auth, log */ }
fun onShare(){ /* parse, auth, log */ }fun handle(action: Action, payload: Payload){ parse(payload); auth(); log(action) }two handlers with identical setupshared handle(action, payload)From the same buckets as this rule.