Sunday, January 29, 2017

If you find yourself in a hole, stop digging

The first law of holes is "if you find yourself in a hole, stop digging".  That is, if you find yourself in an untenable position, it is best to stop carrying on and exacerbating the situation.  This is an incredibly useful law both personally and professionally.

It may seem obvious, but it is surprising how many people don't follow this law. I have been known not to follow it. Sometimes you just can't seem to stop digging; sometimes you don't even see the hole.

Quite often,  holes are easy to spot. Suppose you are in an argument and everything you say makes the person you are arguing with angrier and there is no resolution in sight. Assuming that you are not arguing just for sport (yes, I do have family members who do this for sport), you would stop the argument. You see that you are not getting anywhere (i.e. in a hole) and you stop digging.

A couple of years ago I hurt my knee quite badly. I took over the counter pain medicine, I continued doing exercise that hurt the knee, and I "soldiered through" right up to the point where I could no longer straighten my leg or walk without a limp. I knew I was in a hole but I had basically just kept digging instead of stopping and addressing the issue. I hoped it would get better on its own (oh to be young again). It took spousal intervention for me to get a grip and stop digging this particular hole. And because I had waited so long, it took many medical appointments and 12 full months to have a straight leg, minimal pain and no limp.

Now, consider a small team of developers with a small code base.  They develop a single automated test suite that ensures everything works as expected before the code is released. It catches problems and takes less than 10 minutes to run. Perfect. Other developers join the team and follow the test example. The code base gets larger and now the release test suite takes 2 hours to run. Developers start to complain about it. So they restructure how the test suite runs and get the time reduced to 15 minutes. Great work. Problem solved. Then more code is developed and more developers join the team. The suite takes longer and has to be restructured again.  Test times are now 30 minutes. Not too bad. But the cycle continues. More developers, more tests, more complaining, more reduction. And now the test time is 120 minutes. This is bad. This is a HOLE and it is getting bigger every day. This is not a hypothetical; this is the hole that my team and I dug together for 3 years. We moved some dirt around at times, but we never stopped digging. It was not until we were at a crisis point that I actually saw the hole. We all talked about how we could stop making it worse. After 4 months of considerable effort,  we had a plan which allowed us to add new code in a way that allowed our testing to scale as we needed. We had finally stopped digging. And then we developed a 12-month plan to get out of the hole. If we had stopped a year sooner, the problem would have been significantly easier to resolve. As a result of this experience, the team is now always looking for holes and thinking about how to stop digging.

Learning to spot holes and realizing when to stop digging are skills that you can develop. But they do require awareness. So start looking out for them.  Listen when someone tells you that you might be in a hole. And when you find yourself there, do yourself a favour and stop digging!

No comments:

Post a Comment