| In fact, I think you can tell a competent software developer from an incompetent one with a single interview question: What's the worst code you've seen recently? If their answer isn't immediately and without any hesitation these two words: My own. Then you should end the interview immediately. Sorry, pal. You don't hate software enough yet. Maybe in a few more years. If you keep at it. I have always enjoyed Jeff's columns and maybe I'm missing a subtle point (or just taking the bait), but this may be the worst "advice" I've ever read on hn. If someone told me that the worst code they've seen recently was their own, I'd wonder why. I feel confident in my own ability to usually write excellent code on the first try. Sure, it may need some refactoring, optimization, and flushing out of features, but it works, it generally works well, is very well documented, and can be easily enhanced by myself or someone else. If it's not right on the first try, I will fix it before I promote it. Shame on me (and anyone else for that matter) for leaving behind garbage for someone else to inherit. I've cleaned up far too many messes to allow myself to become like that. I'm probably not alone when I say that I love developing new code and often hate maintaining someone else's mess. Jeff is right about one thing though, almost everything I ever inherited was crap in one way or another, probably written by someone "less than senior". I'd rephrase the whole interview question: "What's the second worst code you've seen recently?" "My own." "OK then, what's the worst?" "Everyone else's." That's the one I would hire. |
Huh... I generally don't enjoy Jeff's column, but this is the first one where I was nodding my head the whole time. In fact, I had even copied the above quote from the article just to comment on it, but in affirmative agreement. To give some context, I'm on a team that is about to ship a very, very large project, and I have to say that I honestly believe my team's part to be the worst bit of it, and my own contribution to be the worst part of my team's code.
Well, maybe not really...but I can't shake this feeling every time I go in to work.
Here's why I think Jeff is right: Software, done well, is like magic. You don't see the arrays and pointers, you don't see that it was programed with objects and/or functions. You see an interface, you click some buttons, you type some words, and BAM! You get exactly what you want. At least, that's the user experience. If, however, you're the one writing the code that makes the magic work, then you know what's going on under the covers. You see the arrays and pointers and objects and functions. The magic is dead. The code is just a repulsive, heaping pile of bits with no special properties whatsoever.
If you tell me that your code is not the worst code you've seen recently for X, Y, and Z reasons-that-only-make-sense-to-a-programmer, then you've missed the point entirely.
I imagine the Wizard of Oz might have looked at his contraption and thought to himself "This is the worst hunk-a-junk illusion I've ever seen."