3 ms·
> No. That's the trap of Goodhart's Law. You need something outside of your metrics so that your metrics don't become your target. How can you make a metric ou
by parminya 5y ago
> No. That's the trap of Goodhart's Law. You need something outside of your metrics so that your metrics don't become your target.
How can you make a metric out of "we aren't really sure what the direction of change for this feature is going to be, so it should be easy to refactor"? and why would that metric be any more likely to fall victim to Goodhart's Law than "the code should be clean"?
- 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.