Productivity

This is reassuring: a good programmer might write about 10 lines of code a day in the long run. I often recognize this in my own work without believing it’s normal. Before I started doing this professionally, and before I learned that you’re supposed to think before you start writing code, I’d have guessed 500-1000 lines. Part of it’s just that good code shouldn’t really take ten thousand lines. But the other part is that programming is really much more about thinking and just slightly about actually producing code. I’ve known for a long time that “lines of code” is a horrible inaccurate measure of productivity, and yet I can’t stop counting subconsciously.

I think it’s probably normal for programmers to have days when they spend the entire day tracking down an obscure bug. You can’t reproduce it, but then after another 30 minutes of going through exception logs you figure out that it only happens in some oddball case, and finally you’re able to make it fail, though you still don’t have the first clue why. You start looking through it more closely, and start debugging in earnest. Finally, after a couple hours, you find the line of code where the weirdness is happening, though you’re still baffled about why it’s failing the way it is. And then it finally hits you what’s happening, and it’s something really trivial and kind of silly. You chuckle, make some extremely trivial change to one line of code, check it in, and then it’s 5:30 and you have a train to catch.

I still try to measure my productivity in terms of lines of code. All day and I made a minor change to one line? What a waste! But what’s hard for me to get used to is that everyone else just sees that I spent all day working hard on a difficult problem before emerging victorious. And yet my total time spent writing code was about one minute, and my total output was a trivial change to one line.

Of course we have days when we add a lot more. I added about 100 lines today, but that’s because I added some new classes and added several features that took long and floury code. But, in the game where productivity is measured by lines of code, it makes up for the days when I’ll work even harder and end up netting one line of code. Or “worse,” the days when I delete substantially more code than I add.

One thought on “Productivity

Leave a Reply

Your email address will not be published. Required fields are marked *