Why running made me a better software engineer

Scream if you want to code faster

Running and software engineering are two very different disciplines. Running is fundamentally a very simple activity, software engineering can be pretty complex. So how can slamming your ham poles against the ground repeatedly to the point of exhaustion improve your coding? That’s what I’m going to try lay out here.

Also, FYI I had never really run until I hit 23, and I wouldn’t say I’m a good runner but it’s all relative so I try to only compare me to myself, and I’m a much better runner than I was before I started running… Get out there and give those legs a spin.

People sometimes ask me for advice on what they need to learn to become a better software engineer (I’m of course flattered because I still have a long way to come myself), but I think it’s even the wrong question to ask. Writing ‘good’ software isn’t about having some special technical knowledge or super in depth understanding of the language implementation (although having those things is cool too).

Photo by Sarah Pflug from Burst (with some adjustments in MS Paint from me, which you might have noticed). I personally do not often look this scared when running.

Writing ‘good’ software is about building good habits and sticking to them; learning how to write a good test is unlikely to take more than a day, but writing suitable tests for all of the code you write is about discipline; learning what good readable code looks like doesn’t take long (and should also be intuitive), but ensuring that the code you write is readable and self documenting takes discipline; adhering to a formatting standard requires zero thought, but you have to be disciplined enough to stick to it.

Obviously there’s more to writing good code than those examples, and getting good at doing these things has a learning curve, but fundamentally you have to commit to doing a few simple things every time you write code. You have to get up, put those running shoes on, get out the door, and getting to the finish line every time.

When you stop being disciplined about running regularly you lose your fitness and everything gets harder when you start again. When you stop being disciplined about writing quality code, your code degrades and it gets much harder to make changes or add functionality safely.

If you’ve worked in programming for a while you’ve probably (hopefully) become more productive over time. In the very beginning you might remember spending hours patching together Frankenstein code from stackoverflow, barely scraping together something that runs; you might now have gotten to the point where you can implement some relatively complex code changes from start to finish largely without needing to check any external references (or if you’re not there yet, you will get there!). However, one thing I noticed for myself is that I had become more productive while also working less hard, maybe that’s the dream, but just imagine what you could build if you worked just as hard as before but with all of the extra efficiency.

As you get more experienced you get more bang for your buck, but you still got a lot of bang left, so you could make even more bucks!

How has running helped me here? If you want to go faster you have to work harder, but not just on race day itself; you need sustained training — putting in less training effort results in performance that drops significantly. That training doesn’t get easier, your benchmark for performance just keeps moving as you get faster, you are capable of unlimited speed (but you will probably plateau before hitting light speed). You get out what you put in, so dust off those gym shorts/keyboard and put the effort in!

I will attest that the hardest humps to climb are the ones after a long time away from training, it’s like learning to code all over again. To keep performance high, you have to keep effort high.

There are literal shortcuts of course, but to run 5km in a certain time you unavoidably have to cover 5km by foot in that time. Writing code is quite different, requirements are often vaguely specified and it can be tempting to find the path of least resistance, implementing the minimum thing that approximately adheres to those requirements, doing so you can convince yourself (and others) that you did the best work you could even though deep down you know you took an easy route that may not have been the optimal choice (maybe in terms of scalability, reliability or extensibility). I’ve heard this called ‘giving yourself a way out’ (heard that from a guy in spin class who was killing me).

If you have never given yourself a way out I applaud your resolute mind, I think however that it’s pretty common human behaviour and until I started running I hadn’t developed an awareness of how often this happened for me, nor had I developed my mind muscles against it. It’s very hard to lie to yourself about the fact that you stopped running before you said that you would, or convincing yourself that you ran a personal best when you didn’t. Stop lying to yourself altogether and build the best damn software you know how to build.

Don’t forget that your health is also important, running is pretty good for your health. Not very software specific that one, but good to keep in mind.

Conclusion

Running is obviously a very physical activity but it filled a mental gap for me which resulted in me becoming a more disciplined, and more effective software engineer. As software engineers we’re taught to be lazy, and make our lives as easy as possible with automation and tooling that boost our productivity, and that’s great, but I think sometimes we forget what it’s like to not be lazy, not look for a workaround and run straight through that wall. You may well say that you can do all of these things without running, and that’s true, but you really find out what you’re made of when your lungs are bursting 1km from the finish line on the way to a PB and all you want to do is give up and start walking.

Run like nobody’s watching, code like nobody’s watching, and hold yourself to your own standards.

Hope this didn’t come across too preachy, your mileage may vary but I wanted to share because running helped me, and maybe it could help you too. Stay blessed!

Data Scientist/Python Engineer from the UK. Living in Amsterdam, working in payments.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store