soeren says

A Matter of Honor

March 1st, 2008

So you write a piece of code.

It doesn’t have to be excellent. Realistically, given constraints in time and budget, and not knowing entirely right from the start just what the implementation is supposed to accomplish, including every single edge case, your code may very well end a mess.

Does that embarrass you? Or do you not care, because, after all, “it works”, right?

Me, I’m embarrassed. Code efficiency is frequently not a concern to me (which I would argue is okay, since I don’t tend to write performance-critical things). But trying as hard as possible to make code readable and ‘elegant’ certainly is. I always know I’ll never quite achieve that goal, for customers want solutions fast and cheap, and virtually never can even tell the difference between what’s well-written and what’s not. But to me, the difference matters nonetheless, and when I spot something that obviously can be solved in a nicer way, I do so.

Oftentimes, you can call that process ‘refactoring’. Whether it’s making symbol (variable, function, etc.) names more comprehensible and organized (hey, can we settle on a single style?), or merging multiple blocks of code in different source code files into one unique function because they happen to accomplish the exact same thing, it helps. It’s a little step, but the next time I come across the same lines, I think to myself ‘good thing I cleaned that mess up, for this time, everyone else will understand it better, and I will be less bothered by it’.

From my point of you, if all of the above seems agreeable, non-disagreeable, perhaps even obvious, you’ve got what it takes to be a good teamwork programmer. You understand that committing code to the shared repository is not generous, but essential, and that doing so frequently, split up into atomic, self-contained pieces of resolved micro-tasks helps everyone.

Unfortunately, this isn’t true for everyone. Some developers apparently feel that applying a devil-may-care attitude to what they’ve written is acceptable. I don’t blame them for wanting to spend their spare time differently than constantly having think about what they’ve worked on. But when their commit consists of badly-written code, is delivered a day after I need it (rather than simply the moment it was done), is incomplete, and meshes solutions to multiple unrelated problems together, it drags down my efficiency, my motivation, and my honor.

When I create something, I want to maximize how much others can benefit from it. Otherwise, why bother?

Tagged , ,
Posted in Rants

Share | No Comments