Why Software Developers are Not Machines
I’ve done a lot of experimentation around my own productivity as a developer. For what it’s worth I think that the lessons I’ve learned from my failures and successes are worth sharing. Especially because in the startup community, everybody is trying to bring the best performance out of themselves, sometimes with devastating effects. This article is more about behavior around your work that makes you productive than it is about how you do the work itself. Scheduling your day, having a healthy diet and certain types of exercise contribute more to productivity than the processes you follow and techniques you use while you develop. Processes and techniques help a lot but having a sharp mind and a lot of energy contribute much more, at least in my case. I’m very interested to hear how other developers do it because I believe this topic has been undervalued.
You are not a machine
Many developers I’ve met treat themselves as a machine that converts specs and coffee into working software. This analogy might have a spec of truth to it, but it doesn’t do justice to the influence your humanity has on your productivity – both positive and negative. In my experience, it is much better to work with your humanity, rather than to ignore it. The advice you’ll read is therefore directed at things you can do to make your human traits work for you, rather than against you.
A healthy mind resides in a healthy body
To get the best out of your brain, you need to ensure that it is supported by a healthy body. The best brain activity happens when you’re awake and the brain is supplied with energy and oxygen. This you can ensure by doing three things: eat well, sleep well, stabilize your biorhythm.
A diet for your brain
The brain runs primarily on sugar. More so than other organs that can also run on burning fat or proteins. At top capacity, the brain alone can account for up to 30% of the energy consumption of your body. Many developers translate this into the need to eat fast sugars and drinking energy drinks or coffee. This is a short term strategy. The problem is that if you use a lot of sugar, not all the sugar is burned by the brain and your body will get better at storing it as fat. Being overweight reduces your ability to free up energy for the brain and to supply enough oxygen, pulling you into a vicious cycle.
A better strategy is to eat regular meals of slow sugars and make sure your supply is ready when you need it. A bit of coffee doesn’t hurt, but from my experiments, I noticed that you’ll quickly develop a tolerance and you’ll need more and more to actually get the energy boost from it that you want. The difference between no coffee at all, and 10 cups a day is very small over the long term. And drinking a lot of coffee has the nasty side effect of reducing your ability to sleep well. Two to six cups before 4 pm should do the trick without keeping you up all night.
A note on Alcohol
Many studies have been done on the effects of alcohol on the body and on the brain in particular. I’ve tried finding the Balmer Peak, I’ve coded with a hangover, I’ve been drinking at different levels and I’ve coded after a strict non-alcohol regime. I like a good time in the pub as much as the next guy, but if I’m honest with myself, drinking has no place in a healthy developer’s life. The difference in productivity after three days of moderate drinking compared to three days of no drinking at all is around a factor of two (for me at least). Because I’m a beer geek, I have tried to optimize this as much as I could, but the bottom line is: you’re paying a heavy productivity price for each drink above one per day.
Sleep deprivation has a devastating effect on your ability to think. As a starting entrepreneur, I’ve had my share of sleep deprivation, and while you can get a lot of chores done if you work 14+ hours a day, the actual high-end creative work, like writing new code slows down to a crawl. I’ve experimented with a lot of sleep patterns, but a solid stretch of 8+ hours per night is unbeatable in terms of risk and effect.
It is possible to stay sharp on very strict sleep diets, like 36h awake, 12 hours of sleep, or 15m sleep every two hours. With these extreme sleep diets however you’ll work against the natural biorhythm that follows light and dark. And worse, if you make a small mistake, you’ll end up with a jet-lag from hell. Stop all forms of working or screen time 2 hours before you go to bed. Make sure you’re in a somewhat dark environment the last hours before you go to bed and sleep in absolute dark and silence. In the dark, your melatonin levels go up, which makes you sleep deeper. During deep sleep and REM sleep, you’ll process the stuff that can get in the way of clear thinking.
Because your brain needs a lot of energy, you’ll need a good supply of oxygen. For this regular cardio is great. To free up ATP from fat (should you ever run short on sugar, which you should) you’ll need mitochondria, and they reside in muscles, so you better make sure you have some of those. Sitting work, which development usually is, is a killer for your body; it is particularly straining for your lower back. Keyboard and mouse use can cause RSI. A good training program that focuses on the shoulders and lower back helps enormously to avoid pain during your work. Pain is a productivity killer, so avoiding it is another great effect of exercise.
When you train your body to support good brain work, you should remember that building muscles and burning fat lowers the energy levels in your body. No need to go for a six-pack or a marathon. Eat well before and after you exercise, a bit more protein, no fast sugars, but don’t be afraid to get some carbs in. Your brain needs them.
Trust me, if you switch to a healthy diet and start doing the right exercises today, by next week you’ll see a dramatic change in your productivity, and you’ll generally feel much better. By then I’ll have an article for you on how to tweak your mental state to make even more use of your specs and coffee to software converter.