One thing that surprises me about this endeavor is how little research there seems to be about writing code quickly. There are a smattering of studies justifying quality in the name of speed; for instance, a famous study found that the longer it took to find a bug, the longer it took to fix it (though I can't find the source). But it's hard to find concrete data on how to write more quickly. Surely Microsoft and IBM must have studied this for decades; after all, a mere 10% productivity increase in coding speed would have huge benefits for both companies.
And yet, if they
have been conducting studies, they've kept awfully quiet about them.
The most interesting analysis I've been able to find is
this post by Joel Spolsky, measuring the time it takes college students to do an identical project. As he reports,
The most obvious thing you notice here is the huge variations. The fastest students were finishing three or four times faster than the average students and as much as ten times faster than the slowest students.
The point of his article is that companies should hire highly productive programmers, which is hard to argue with. But don't we all have a small suspicion that increased productivity can be
taught?
One thing I'd like to do this year is to simply partner with different programmers and see if I can figure out what makes some faster than others. It may just come down to "brain speed," of course, but I suspect there are some processes at work that could benefit everyone. For instance, some programmers tend to just dive into a project and start coding; others tend to step back, create a plan first, and then proceed. The second approach sounds like it would pay off, but it's worth testing; what if our agile approach makes most planning a waste of time?
Testing is another thing I plan to investigate. We tend to write unit tests for most of our code. And yet, for many features of our site, the absolute worst-case scenario is that a few customers see an error message, we notice it in the logs, and we fix it within a few minutes. Does that justify spending a day writing unit tests, and spending time and energy maintaining those tests as the functionality changes? Or what about the question of
when to write tests? Test-driven development encourages you to write tests first. But in a fast-changing business environment, that can leave you with a lot of tests to re-write if the spec changes halfway through the project.
I suspect I'll spend the first part of the year just asking questions like this, to get a handle on
what to measure, before doing much measuring of it. So far on my list: time spent planning, time spent writing the functionality as originally spec'ed, time writing unit tests, time spent reworking functionality based on spec changes, time spent reworking tests based on spec changes, and time spent fixing bugs from the QA process.
Update: I probably should have given myself a few weeks to get into this project before concluding there was no research about it. In fact, it seems that lots of companies have done lots of studies on programmer productivity, as one would hope for and expect. I'm still working my way through Steve McConnell's
Rapid Development, but so far it has cited numerous examples of research and studies that relate to productivity.