November 16, 2009

...Learn TDD with Codemanship

A Little Practice Can Put You Head & Shoulders Above The Rest

I've played the guitar for 21 years, and during that time I've picked up a fair amount of technique and theory, and dabbled in a diverse bunch of musical genres from blues to metal and ambient to classical.

While I'm a very long way from being the world's greatest rock guitar player, even if I do say so myself, I'm not bad. Not brilliant. But above average for an amateur widdler.

Musical ability seems to follow somewhat of a power distribution. The vast majority of rock musicians know a few chords and can strum along to a few classics. Musicians who can play a passable blues solo and can get away with covering bands like Fleetwood Mac or Cream are an order of magnitude less common. Rock musicians who know some basic theory and have a bit of technique and can pick up more challenging stuff (e.g., Megadeth) are as rare again, and take some seeking out.

Rock musicians who would have the faintest clue what you were talking about if you told them "this is a D lydian augmented riff" are few and far between, but such knowledge only puts them a little above average ability.

To be better than most, you only need to practice 30 minutes a day - if you use the time well and don't waste it singing along to "Wonder Wall".

The same's true of programming. Ability to cut code also seems to follow a power distribution, if the hundreds of technical interviews I've sat in on are any indication. The vast majority of programmers are 3-chord wonders. And they're perfectly happy strumming along to the code equivalent of "Louie Louie" and earning an obscene amount of money doing it. 'Cause hey, folks like "Louie Louie".

A much smaller group of programmers read a few more books and try a few more "genres" of programming and pick up an extra language or two.

A comparitively tiny percentage read lots of books, try several programming languages and bother to learn some theory. And they practice. Maybe just for a few minutes a day, or an hour or two a week, but they sit down and they deliberately code something just to get the hang of coding it. They don't get paid for it. They do it entirely self-indulgently. Probably because they enjoy it. (Imagine that!)

In real terms they may be a bit better than average, but in numbers they are pretty uncommon. Maybe 1 in 100 programmers, if we're being honest, rise above mediocrity. I base this on experience of vetting candidates for programming jobs. 9/10 CVs go in the bin. Of the candidates who are invited in for interviews, 9/10 just aren't up to scratch.

Now, to a 3-chord wonder (and his boss), filtering out 99% of programmers looks like unnecessary snobbishness and elitism. But then, I guess, to many 3-chord guitar wonders, Eric Clapton is God.

But trust me, the 1% who got offered the jobs - if I had any say in the matter - weren't necessarily brilliant. They were good. Palpably better than average. They actually could do TDD to a serviceable level of quality. They actually knew some code smells and some refactorings. They had some vague idea what a class diagram meant. They could do a reasonable job of mapping an object model on to a relational database schema. They knew they were supposed to run the tests before checking in. They knew a little bit about how parsers worked. They could knock up a simple regular expression. They roughly understood how some basic sorting algorithms work. We're not talking C A O Hoare here.

And this is why, my merry chums, it makes absolutely no sense to be a 3-chord wonder. It's not that much work to be become better than average at programming. You just need to find an extra 30 minutes a day to sit down and try something new or work at bettering yourself at something you've done before.

You won't get good overnight. It'll take a few years. But you'll be part of that 10% of 10% sooner than you think. And push it a little further and you'll be in the top 10% of that 10% of 10%.

You could even get a special hat made. Now wouldn't that be dandy?

Posted 11 years, 2 months ago on November 16, 2009