Thursday, June 19, 2003

A Different LOC Metric

I had dinner with a good friend of mine here in Boston tonight. He’s technical, too, so we got to talking about code. I mentioned something about how I’ve been programming a lot lately, and it detoured us into a discussion about lines of code (LOC) metrics.

He brought up an interesting one that he’d heard recently. The idea is that it’s not so much a good idea to measure how many lines of code a developer is producing (e.g. 7 per day), but rather how many lines of code they are responsible for. And that there’s an absolute maximum. In other words, once I’ve got 50KLOC, I’m done – all my time is going to be spent in maintenance.

I’m not saying 50K is the number – in fact the number will be different for different developers – but the idea that a single developer has a capacity resonates with me. I know how hard it is to go back to things I haven’t looked at for even a week when I’ve got a lot of stuff going. And forget about supporting code that I wrote two years ago.

What does this mean? A few things, I think:

1)      Refactoring is super important. The fewer LOC you have, the more functionality you can support.

2)      As you write code, you need to hire more people. Duh, but if someone can figure out the numbers, it may help plan. Or motivate refactoring.

Also, in light of recent discussion, it begs the question: does a line of code spit out ten times by a code generator get counted once or ten times? I’d guess the former, but it’s an area I’d love to see experimental data on.

1 comment:

  1. Ping...