Skip to main content

Staying healthy == better code...

As developers on any given day we may put on the hat of many different roles such as the requirements gatherer, interpreter, problem solver, designer, coder, user, tester and many more...

This article aims to highlight links between good coding, more productive development and some best practices for the most sophisticated of systems, our bodies. I encourage you to comment and suggest other techniques that you have found beneficial also.

Let’s get one thing said before we kick off. I for one have been on projects where caffeine and junk food where absolutely necessary to crank out a big ‘go live’ or update code over a 24hr period that could affect hundreds of thousands of people or involved in a hackathon guerrilla event where commodes were more efficient than using the bathroom J. However, when the dust settles and things are a little more normal and day to day, good health habits can make a big difference to not only help you think more clearly but deal with those high pressure situations when they arise tomorrow.


When I was a kid I remember a book entitled “You are what you eat”. It’s a phrase that stuck and sometimes makes a difference when I am choosing my lunch.
There is a ton of differing opinions when it comes to diet so here goes mine. “Balance” That single word gives me complete freedom to eat what I want but at the same time keeps me conscious of what my body needs.
I recently did a 2 week Juice diet in an attempt to lose a bit of weight and fill my body with nutrients, enzymes and basically feel more energised. It worked, I lost about 7lbs and genuinely felt better. Now I have that as a plan at least once a year to do something similar.
Drinking plenty of water each day has been proven to increase concentration, something as developers we need a lot of.
Avoiding a big lunch can aid in productivity because needed energy is not spent breaking down food and means you escape the urge to have nap under your desk.


We have all had the memo or meeting about screen height or keyboard position. I bought a chair last year which forces good posture. If I sit in it for longer than 2 hours my knees have no feeling J but the point is that switching position and being aware of your sitting position is really important. Our bodies have not been designed for long hours of sitting in the same position so the more you move in between or change position the better. 

Below is a chair I have in my office which you are supposed to switch over to for a while each day, it claims to force good posture. It looks a little like a torture device but it does seem to work. The Knees go in first with the bottom on the top part, guiding the back in a vertical angle. The main benefits focus around the lower back which tends to take a lot of strain during a day of sitting.


On a previous developer role we were given a reduced membership at a local health club. So once or twice a week I embarked on having a swim over lunch. Wow what a difference, that complete somewhat forced break really helped me focus better in the afternoon. Swimming is renowned for working many muscles in the body including the lower back which any coder sitting for long periods of time can suffer a bit with.
What about getting to and from work? I was working on a train route for a while and was able to cycle from home to the train and at the other end for a total of about 4 miles. Then at the end of the day it’s all reversed. I can honestly say it was great. Sure I got wet a few times but nothing a pair of waterproofs couldn’t solve, but also I enjoyed many sunny mornings and evenings which is surprisingly relaxing before getting home. There is something very satisfying about arriving home after work, knowing that you already did your exercise for the day during normal work hours.
Everyone’s schedule is different and only you know yours. The point is try and make room for something each day which gets your heart pumping a little and produces stress relieving endorphins.  

Take a break

I was one of the world’s worst at just working through problems without taking a break. However by taking a break, and by that I mean leaving your desk, going for a walk outside the office for some minutes, even when under pressure can make a massive difference to your whole approach to a problem.       

Sleep on it

Sometimes you take a break and you still spend the rest of the day on that, and I quote “Impossible Problem” and can’t see the wood for the trees. Don’t despair, sometimes you need to put the problem down, shift your attention to something a little lighter and just sleep on it. If I had a pound for the times I woke the next morning with a solution to a problem or sometimes in the middle of the night I would be a rich man. The brain is very powerful and sometimes we just need to let its thing.

You may have heard of young developer named Santiago Gonzalez on YouTube where he says "I Dream In Code". Well Santiago, we have news for you, we all do if we just let go and let our brain do it's thing as we sleep.

Don’t take yourself too seriously

Some studies suggest that some seemingly healthy lifestyle’s can lead to stress. My take is that some can worry so much about health and body matters that they basically fail to enjoy life along the way, causing more anxiety and stress than the efforts to avoid it. Don’t be afraid to laugh at yourself once in a while. As developers we can sometimes get a bit proud of our code and not take criticism easily. Remember that every system ever written contains bugs. If another dev. points out something in a code review, embrace it, learn and let go. Life is too short for perfection. Find something to make you chuckle each day, and remember the healing power of laughter.


To develop software well requires a certain amount of discipline. Adding comments, creating unit tests, refactoring, just to mention a few, requires effort on our part. If we train our minds to be disciplined outside of work, it becomes a lot less effort in work to desire that all the planets are aligned and our code and supporting documentation is kept up to date. Having said that creative minds are often not very tidy ones.
As the mind is the most complex of all body parts it is important to avoid stress outside of work. This allows it to focus and work out complex problems with a lot more ease. My personal observation has been that happy individuals with a good friend or family supporting network, tend to be able to focus better and find solutions to problems faster.


·         Eat Well
·         Sit Well
·         Take Breaks
·         Exercise
·         Drink plenty of water
·         Laugh
·         Get enough sleep


I am certainly not a health freak, nor a fitness fanatic but I do believe that if you take a balanced approach and most importantly give it some thought, you can definitely increase your productivity and wellbeing which ends up making you more successful and productive as developers.

For some more musings, checkout my and azure blog here

Popular posts from this blog

Instrumentation with Semantic Logging Application Block from Microsoft Enterprise Library 6

Introduction Instrumentation, the process of auditing and logging in your applications, is a vital part of any enterprise solution. When you are developing applications with Service Level Agreements and specific Auditing requirements, logging is a big deal. Add in the complexity of the decoupled nature of the cloud with Service Orientated Architecture, piecing together a clear view of a business process from end to end can be a challenge. Microsoft has recently released the Semantic Logging Application Block ( SLAB ) to the enterprise library. This article will form the first part of a mini-series, detailing the benefits, pitfalls and examples of how to make use of it in your enterprise. Although new to the Enterprise Library, Semantic logging is not a new concept. It has been adopted for years under different names such as "structured logging", "strongly typed logging" and "schematised logging" to name a few. What is it? SLAB inherits event

Azure Devops - Pull Request Merge Conflicts

Before a Git pull request can complete, any conflicts with the target branch must be resolved. Out of the box, at the time of writing this article, Azure DevOps requires this to be resolved locally. Following best practices to not allow direct commits to our release/master branches further exasperates the problem as we need to effectively clone the branch or go with a rebase approach, both of which break the natural flow of resolving the conflicts as part of the pull request. With this extension, from the Microsoft DevLabs team via the Marketplace, you can resolve these conflicts online, as part of the pull request process, instead of being forced to break flow and resolve locally. Online Experience After adding the extension the new conflicts tab is visible which enables conflict resolution in the familiar side by side review page as shown below: Really nice extension, which should make resolving merge conflicts a much more straightforward part of the DevOps

Windows Azure Storage Emulator failed to install

CodeProject Windows Azure Storage Emulator failed to install When attempting to install a new version of the Azure Storage Emulator either as a separate installation package or automatically as part of an Azure SDK update, you may run into an error message which states the storage emulator has failed to install. This can occur using the Web Platform Installer (WebPI), NuGet Package Manager or when performing the install manually. Below is the message received using the WebPI.   Storage Emulator Background  (optional reading) The windows azure storage emulator executable lives under the Microsoft SDKs directory as shown below: Configuration If we take a quick look inside the WAStorageEmulator.exe.config file we can see each of the storage services pointing to local service endpoints. <StorageEmulatorConfig>     <services>       <service name=" Blob " url=""/>       <service