I can sum up what I have learnt this week in one sentence:

If the problem seems too difficult, you might be solving the wrong problem.

Don’t do what I did

Recently, I was struggling with a problem that I thought was particularly challenging. After multiple iterations, I had managed to ‘reduce’ my solution to a flowchart spread over only three sheets of A4 paper. Even though I knew that what I had drawn would work, I still had that nagging feeling that there was a better way. I called over my senior developer and we talked through the problem together.

After discussing it for ten minutes, he helped me to realise that my solution to the problem was not the issue.. I was solving the wrong problem.

After totally changing my approach, it turned out that the thing I had spent the best part of a day struggling with could be done cleanly in fifteen lines of code. It just took somebody else to help me realise it.

Most of what we do is trivial

As developers we live for the difficult problems; the ones that require three weeks, a whiteboard and an entire team to solve. The majority of the things we do in our day-to-day work don’t fit in to that category. If we face a problem that seems too complicated, it probably is. It’s just that we cannot always see it for ourselves.

It’s very easy to get tunnel vision; to come to a problem and immediately decide how to solve it in our heads. It then becomes very difficult to take a step back and evaluate whether the path we have chosen is the right one. Sometimes it takes another developer to sit down and discuss it with us to make us realise our mistake.

This outside influence can provide what some would call the 30,000 foot view. They can come to it with no pre-conceptions and tell you that your solution is totally over-complicating the issue. They can force you to re-evaluate it from scratch.

Making the kind of mistakes I made is part of the learning process. No matter how experienced you are, these situations will happen to you. The thing that makes you a good developer is recognising that you need another viewpoint before investing too much time in the wrong solution.

Next time I am over-faced by something that seems too complicated, I won’t hesitate to ask somebody to sit with me and discuss it. If it is a ‘three weeks and a whiteboard’ problem, the five minutes spent discussing it now is insignificant. It’s more likely, however, that I am over-complicating it, in which case that five minutes will be paid back in spades by the quicker solution we arrive at together.