If it hurts, do it more often

There’s a good chance that regular exercise will help you become a healthier person. The more often you go to the gym and lift weights (or whatever you like to do), the more strength you will gain, and as a result, the easier it becomes to repeat the same exercise. This is possible because your body will slowly but gradually adapt to the stress of exercise.

While that’s obviously a simplified explanation – there’s a lot more to be said about adaptation and exercising the right way without getting injured – this is generally true: Practice something long enough and you will get better at it. Or putting it in a more catchy way: If it hurts, do it more often. Eventually, the pain will fade away.

The great thing about this principle is that it’s not limited to sports – you can apply it to any useful activity that can be done frequently. In his post, Frequency Reduces Difficulty, Martin Fowler explains the idea using Continuous Integration as an example. He writes:

Most programmers learn early on that integrating their work with others is a frustrating and painful experience. The natural human response, therefore, is to put off doing it for as long as possible.

He continues:

[…] if you do it more frequently, you can drastically reduce the pain. And this is what happens with Continuous Integration – by integrating every day, the pain of integration almost vanishes. It did hurt, so you did it more often, and now it no longer hurts.

But why is doing painful things over and over a good idea? According to Fowler, there are three main reasons, all of them manifested in agile thinking:

So pain doesn’t necessarily have to be a bad thing. It can lead to better systems that are decomposed, automated, and easier to change and reason about.

In the Werkzeugschmiede team, we also like to feel the pain before doing something about it. For example, before investing time in setting up a proper staging environment, we had experienced how hard it was to test changes prior to deploying them to production. Later, when staging was in place, we learned the hard way that our automation wasn’t as reliable as we thought. We ignored the problem for a while – again feeling the pain – until we finally decided to rebuild staging from scratch once a week, thereby ironing out any flaws in our automation.

There are still other things that hurt us, in different ways. Let’s do those things more often and see where it leads us…

Image credits: Flickr

Tagged under: Agile, Continuous Integration, Automation, Wonderland