Vlad's Roam Garden

Powered by 🌱Roam Garden

when a group of values is passed around together it can indicate a missing concept

Evergreen clean code heuristic OOP make-public

A group of variables that is passed into a set of function can point to a missing type. By creating it you'll make your language more expressive and [simplify your function's interfaces]([[functions should have a small number of arguments]])

You'd also likely be able to refactor your code to redistribute the responsibilities more clearly.

reference

When you notice that a group of values are always used together
This may serve as a suggestion that there’s a missing construct.
A first step might be to create a new type with fixed public fields — just giving the group a name highlights the missing concept. Later we can migrate behavior to the new type, which might eventually allow us to hide its fields behind a cleaninterface, satisfying the “composite simpler than the sum of its parts” rule.
Growing Object Oriented Software guided by Tests p58

when a group of values is passed around together it can indicate a missing concept