This post is inspired by an article in the Guardian by Dr. Daniel Glaser called "The benefits of distraction".
A couple of days ago, I found myself stuck on some C++ code. I exhausted every possible way to achieve what I wanted (or so I thought), and it just wasn't working. So, I decided to go for a walk and find pick up my lunch from somewhere new. I spent about half an hour walking in to different restaurants and supermarkets, but ended up getting the same thing I get every day! Upon my return, with my mind refreshed, I managed to find yet another way to write what I wanted, and my program worked exactly the way I wanted to.
Surprisingly, this was the first time I actually took a break from my work to solve a problem with my work. I would usually think it would be counter-productive. This is definitely a technique I will be using from now on!
I went for a walk to distract myself. What do you like to do to distract yourself from work?