Hacker News new | ask | show | jobs
by GartzenDeHaes 2019 days ago
One of the most useful programmer metrics that I've found is code churn: (new lines + deleted lines) / total changed lines. Instead of telling you how much work your programmers are doing, this metric tells you what kind of work your programmers are doing. Small numbers mean bug fixing (end of project and maintenance) and large numbers mean new development and features.
1 comments

What about high deletion amounts? I've merged PRs with hundreds of thousands of lines deleted and none added. It took quite a bit of sleuthing to figure out someone had left entire copies of directories side by side with different names, where one was completely unused. Conversely, someone had a huge addition to the repo that actually was total garbage.
A large change to the code base would indicate to me that the product isn't ready to ship or test, possibility. At the very least, it would prompt a discussion about the code and how we are managing it. Maybe we need some process changes or tools to prevent junk code from accumulating.

Edit: if you're talking about the math, I think "changed" includes added and deleted. So, it's the ratio of added and deleted to the total change.