Yes, you can measure software developer productivity
mckinsey.com
mckinsey.com
> Further, attracting and retaining top software development talent depends in large part on providing a workplace and tools that allow engineers to do their best work and encourages their creativity.
So do that!
Happy people are productive, and talented, creative people move your business forward.
An option to deal with those people is to just fire them, simple. But that means you are giving up on them. Another option is to have an hybrid approach: those that work great with having happiness as a motivation, we can just continue to foster a happy workplace; for those that don't care about happiness, find another approach, one example would be to introduce KPIs for those specific people and formulate a performance recovery plan if needed, if all else fails, fire them.
Happiness in the workplace is more often than not related to other aspects than the primary process of developing software. If the subject matter itself (as in: "I earn a living while hating the building websites in PHP") is the root cause of unhappiness, no recovery plan, KPI or reward can fix this. Best find another job.
Forcing goals onto a disgruntled/unmotivated engineer will end badly. Giving no goals to motivated engineers will also end badly. Giving bad, unrelated or unachievable goals to motivated engineers will end in disgruntled or unmotivated engineers.
You have to get both right.
She states that the only useful measurement is how fast can a code change get to production.
But as you allude, while it may be true that you "lose" 2 hours per day 3 days a week in some sense of productivity, that loss may simultaneously be the essence of some other sense of productivity. By suggesting it's "just data" and more of that is always good, McKinsey is (intentionally) glossing over / ignoring / hiding the fact that they will be doing the framing. (And that their framing is historically short sighted, superficial and often very wrong. See also: https://www.amazon.com/Big-Consulting-Businesses-Infantilize...)