Software engineering is cognitively taxing work. Each day is spent in many hours of deep focus. Over the years you refine the capacity to enter and stay in this deeply focused state. This enables you to work on complex tasks for long periods.

It comes at a cost though. I like to view the mind as a large ship. It takes some time to bring it up to speed and get into that deep state of focus. Once you reach this state of mind work can almost flow by effortlessly. However, when the time to work is finished and you want to wind down for the evening, this too takes time. Just like a boat, you can’t just hit the brakes and stop on a dime.

Over the years of my career in software engineering, I noticed more and more that I was finding it hard to sleep. Not for lack of tiredness, but just that my mind was racing, turning over work problems at the same pace as when I was at my desk.

I could not switch off.

Then, around 6 months ago, I decided to give running a go again. I had always been into running since I was young, but I dropped it during my college years in exchange for a variety of other hobbies.

I experimented with running in the morning, but I’ve never been much of an early bird, so those runs were always pretty unpleasant and done in a bit of a daze. Something clicked though when I started doing my runs immediately after work. What I noticed was that when I got up from my desk, I would feel exhausted, but the exhaustion was a mental one, not a physical one.

As soon as I’d put my running shoes on and take my first steps out the door I would notice how my body was bursting with energy. After enough of these runs, I knew that all I had to do was get over the motivation hump to get out the door and I would be rewarded with an energised body ready to hit the road.

This was a real revelation for me. The sensation of exhaustion in the mind tricks you into feeling like you physically can do nothing after a day at your desk, opting to hit the couch and play video games.

Get out of your head

Once I discovered that I could manage to get out and run after work consistently, I started to notice the benefits. First of all, my sleep improved. I track my sleep with Whoop, and before I started running consistently my average time to fall asleep was 43 minutes. Now, it’s 27 minutes, cut almost in half in just a few short months.

As I mentioned, my racing mind was my main barrier to falling asleep. This has vastly improved as a direct result of the running. Running as a sport is pretty intensive. Especially at the start when you aren’t very adapted to the physical requirements. As a result, your focus is drawn out of your mind and into your body.

I especially like more intense runs as an antidote to a particularly tough day of coding. They simply demand all of your concentration, which is surprisingly rejuvenated with each step.

Get into bed truly tired

The other, probably more obvious, side effect of running is you’re going to physically tire yourself out. Lying in bed with a racing mind is certainly a problem for falling asleep, but it didn’t help things that I was also lying down with a body that had only taken 2 or 3 thousand steps around the house during the working day. Even a short run is enough to get the blood pumping and expend some of the pent-up energy in the body.

Releasing that energy is a great step towards creating an internal climate suited for falling asleep fast because the more you exercise the more recovery your body needs, and it can become hard to fight that even if your mind is racing.


Running is a gratifying sport to pick up and I think it’s well suited to software engineers, who tend to appreciate solo time a bit more (not to say that you can’t make running sociable!). Once you get past the ‘month of pain’, which is undeniable when starting or re-starting running after a long time, you will be treated to a reliable salve to the overworked mind that software engineering produces.