[This was originally published on June 25, 2009.]
I’ve heard the phrase “Excuse my poor code” (or words to that effect) a number of times recently. I’ve said it to myself about my own code (if not to others), I’ve heard two of my work colleagues say it, and I’ve had a customer’s sole developer apologise ad nauseum about his code.
I’m not here to make any determination as to the veracity of these claims but the thing that I find interesting is that in all cases, the majority of the code in question was written by a single person.
Now, this may be difficult for some to believe, but I inherently don’t trust my own opinion. I do tend to confidently put ideas forward as bold assertions to be shot down when I’m wrong. The confidence comes from knowing I’ll defend my ideas to the hilt and not take it personally when my argument is proven flawed.
I hate working alone because I don’t trust decisions that weren’t arrived at through furious debate. I don’t like developers working alone no matter how good they are (or think they are) because I don’t trust they can be objective enough by themselves. In fact I don’t care if they’re working in pairs of developers or not, I just want their decisions to be scrutinised by smart people as early as possible.
The idea that the majority of a developer’s work involves going off to think on their own is totally nonsensical to me. It feels like a lot of hocus pocus going on behind closed doors and then poof a few days later something is divined. Not only is the process opaque, but the possibility for smart people to scrutinise is left as late as possible. Sure, I like to sit and ponder without the hullabaloo of every man and his dog trying to give me their 2c worth as much as the next but the lack of transparency and scrutiny in this as a process is something I find very difficult to accept.
Smart people working alone is even worse. They’re often implicitly promoted to the position of grand wizard, the seer and knower of all things. They go away, think about a problem and come back with much fanfare (trumpets playing, drums beating) to bestow upon the people their creation who will wonder in amazement at the design, so simple and yet, so complex, that only they can truly grasp the significance of what they have achieved.
When I write code on my own, I feel personally, individually, responsible. When I write code on my own, the pressures I feel are, mostly, self imposed. They make me lie awake at night. They make me code into the wee hours of the morning, on the train home. I worry that I’ve missed something. I start to believe my own hype. That I’m good enough to do this on my own. That because I did most of it on my own, I should fix it on my own lest someone else realise how crap my code is. In a vacuum my ideas have no predators. As importantly (if not more so), my priorities have no predators. I race towards a goal without stopping to re-think that goal because I’m stuck in a vicious cycle of self doubt and self confidence. Moreover, when I work alone, the production of code becomes the focus and not, as I believe it should be, thinking!
When we write code together we have shared code ownership. I feel like someone has my back. That even if we got the decision “wrong”, we decided together and if two smart people can’t get it right then maybe it’s good enough, maybe there are diminishing returns for adding more people to solving the problem. When I go home at night, sure I might tinker but I know there’s not much point to spending a lot of effort because I’ll just be re-doing it tomorrow anyway. And if there is something we missed, someone has my back if need be.
I speak as one who has been, done and experienced others doing all of the above and decided once and for all that it’s just not worth working alone. Having more than one person working on something WILL cost more but I assert that the result will be better and will be achieved more quickly and with less churn. Anyone who thinks they’re smart enough to do otherwise needs to learn to keep it in their pants.
I have this mental model of software development that is akin to the way I’ve heard Abraham Lincoln’s cabinet described. Apparently he got a whole bunch of really smart people together, even those from opposite sides of politics, and let them argue it out. His (Lincoln’s) role was to decide when to stop the debate and which idea(s) to act on.
I think that’s what collaborative development should be.
YMMV :)