My Favorite Debugging Tip: Get Up and Take a Walk!

We’ve all experienced the mounting frustration that arises when we’ve spent multiple hours trying to solve a problem. You have a sinking suspicion that there’s something trivial that you’re missing, something which would make everything click and start working correctly again.

In these kinds of debugging situations, it’s easy to enter a tail spin. The Wise Ones recognize that in this frustrated mental state we are impaired and not likely to solve the problem. We need to give our brains a chance to reset and to consider the problem in a new light.

In such situations, common advice is to utilize Rubber Duck Debugging. However, our faithful duck companions also have bad days, leaving you no better off than before you explained your problem in detail.

At this point, there is only one tool left in the toolbox: get up and take a walk.

A problem with a piece of writing often clarifies itself if you go for a long walk.

–Helen Dunmore

Taking Walks, a Common Cure

In my post How I Schedule My Day as a Consultant, I emphasize the importance I place on taking a break:

You cannot be effective if you are wrapped up in a frustrating task. Frustration clouds are thinking, and inevitably you waste time on that activity.

If you recognize that you are frustrated, stuck on a tricky problem, or running around in circles, take a break. A five to fifteen minute walk will help re-energize you and reset your physiological state. In many cases, you will return to your work with solutions or new ideas to try.

Sometimes all we need is a little fresh air and separation from our problems.

I first started pondering the importance of taking walks while reading Seneca, the ancient stoic master. Seneca believed we should take frequent walks to refresh ourselves, because constant work will fracture our mind:

“The mind must be given relaxation – it will rise improved and sharper after a good break. Just as rich fields must not be forced – for they will quickly lose their fertility if never given a break – so constant work on the anvil will fracture the force of the mind. But it regains its powers if it is set free and relaxed for a while. Constant work gives rise to a certain kind of dullness and feebleness in the rational soul.

Seneca also righty points out that we are refreshed by the open air and deep breathing afforded to us by walking:

We should take wandering outdoor walks, so that the mind might be nourished and refreshed by the open air and deep breathing.

But it is not just ancient philosophers who spout recommendations to walk. Many writers have been known to love long walks, including William Wordsworth, Charles Dickens, Nassim Taleb, Soren Kierkegaard, Lewis Carroll, Friedrich Nietzsche, Immanuel Kant.

When a traveler asked Wordsworth’s servant to show him her master’s study, she answered, “Here is his library, but his study is out of doors.”

— Henry David Thoreau, Walking

Henry David Thoreau dedicated an entire essay to his love of Walking. He is not shy about his disdain for non-walkers:

When sometimes I am reminded that the mechanics and shopkeepers stay in their shops not only all the forenoon, but all the afternoon too, sitting with crossed legs, so many of them—as if the legs were made to sit upon, and not to stand or walk upon—I think that they deserve some credit for not having all committed suicide long ago.

You can afford a break. Even better, make walks a part of your morning and evening routine.

Get outside. Enjoy the scenery. Enjoy being away from your work.

You will return from your walks with a stimulated mind. You may think that you’re taking a “break”, but you really end up smarter and clearer than you were when you left.

Further Reading

Share Your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.