Don't shave the yak, ask 'Why are we doing this?'
One of the very common pitfalls I make when working on things is to get so engrossed in the technical details of the problem that I completely forget the reason for doing it in the first place.
Over the last week or so I have noticed myself trying to solve some ridiculous problems without considering whether I am solving the right problem in the first place.
To give an example, I was working with Hibernate earlier in the week trying to setup a new mapping between two entities which involved creating a composite key on one of the entities, which led to us having to work out how to do that on the database, then editing our migration script, then trawling Google to work out why our mapping wasn’t working, before a colleague overheard our pain and pointed out that we had over complicated matters.
This is commonly known as yak shaving. I’ve read several examples of this but the basic premise is that you start out intending to do one thing, realise that you need to do something else to achieve this, then something else to do that, and so on until you’re so far away from the original problem that you forget what it actually was.
A colleague of mine has been using a quite simple yet effective way of helping us to stop doing this so frequently - they simply ask ‘why are we doing this’ before we start doing anything and then when we seem to be going down a path that is leading nowhere.
From what I understand, this is fairly similar to Toyota Production System’s 5 Why approach to problem solving although I imagine it is probably a little less annoying!
I tend to use the somewhat rough guideline that if something seems overly difficult to do then we are probably doing it wrong much the same way that if something is very difficult to test then the design probably needs looking at.
In summary, take a step back, consider what it is you’re trying to do, and don’t shave the yak!