Norman Clarke

Programming open source code for fun and profit!

A Little Knowledge is a Dangerous Thing

One of the worst things you can do to yourself as a programmer is assume you know things that you in fact do not. This attitude will lead you to waste a great deal of time and energy, because it will usually require deeply frustrating and painful experiences (like debugging your "awesome" code from 6 months ago) to make you unlearn what you thought you knew.

For example: A few weeks ago I had an exchange of messages with a user on Github who wanted to add some code to one of my projects. This person had some interesting ideas but was obviously an inexperienced coder because, for example, he wasn't sure how to write tests and the changes he sent me broke my tests. He asked me a few questions which indicated that he didn't really understand how the code worked.

Nevertheless, he had some interesting ideas and was taking the time to work on my code, so I tried to work with him to get the patches in shape. Just because someone has less experience than you doesn't necessarily mean they can't come up something better than you did. And... it's usually a good idea to follow your own advice. So we ended up having a long exchange of emails, in which he either "agreed" or "disagreed" with what I tried to explain in each reply.

Now, everyone is entitled to their opinion, but if you think about it, it's a little strange to agree or disagree with somebody's assertions about code they wrote when you don't have enough experience to know how to write tests for your modifications, or even run the ones that already exist.

The fact that he was already agreeing or disagreeing with things I said about the code meant that he had essentially precluded the possibility of learning something from me: the best way to ensure you never learn something is to assume you already know it when you don't.

Another way in which people often make these kinds of assumptions is to consider their personal tastes to be a reference of objective quality. If you want to see this in action, just ask someone whether you should use Haml. You're more likely to hear something like this or this, rather than a reasoned response or "it depends, what are your needs?"

We programmers tend to pride ourselves on being "knowledge workers," when in fact most of the time we act more like "opinion workers." "Arrogance" was not one of the virtues of a programmer described by Larry Wall - working hard to avoid it is one way for us to become better at what we do.

Published