2 ms·
"Easy to refactor", AFAIK, can be approximated via LoC within functions and classes; dimensionality of functions; cyclomatic complexity; etc. Those are the metr
by RangerScience 5y ago
"Easy to refactor", AFAIK, can be approximated via LoC within functions and classes; dimensionality of functions; cyclomatic complexity; etc. Those are the metrics; you can produce reasonable and grounded numerical measurements of them.
But, if you were to just optimize for those metrics, I bet you'd run into issues, whereas if you use those metrics as part of your process for determining if it's easy to refactor, then yeah, I'd expect you to be less vulnerable to Goodhart's Law.
"Easy to refactor" is a goal, not a metric; low cyclomatic complexity is a metric, not a goal. IMO.