It wasn’t too long ago that I used to have a lot of trouble sleeping. Once I was asleep I was OK, but getting there was troublesome. As my head hit the pillow, I’d start trying to solve all the development and design problems that I encountered that day. The impact hit me the next day like a tonne of bricks; I could feel myself battling to stay awake on the commute. Every night the plan was simple: Go to bed, clear the mind and sleep. Unfortunately, once clear, my mind would jump on the opportunity for undisrupted thought and start re-factoring code and schema designs. I even started to take sleeping pills to try and get my brain to co-operate at bed time.
Sky is blue – more on this at 11
I knew that caffeine was bad for sleep, so that’s why I never drank any tea or coffee after 6pm. It shouldn’t be a surprise that the villain in this story is caffeine and the “don’t drink coffee before bed” mantra is nothing new. However, I didn’t realise that having 7 cups of coffee during the working day created a slow release insomnia bomb in my brain. I will admit that I got the shakes now and then during the day, at which point I’d lay off the coffee for a while. However, my assumption was that because the shakes went, the caffeine had worn off. Time to head back to the coffee machine!
At that time of my life, I would not have classed myself as someone sensitive to caffeine. I just connected the insomnia to my job and thought that the culture around software development was to blame (skills development, personal projects, late nights, etc).
To make matters worse, a new symptom developed – indigestion. Frustratingly, it also made its appearance at bed time. I couldn’t sleep on my side because as soon as I did, I’d feel the acid in my chest. I started to sleep on my back to ease the symptoms, but then the acid pains started during the day. I started to buy in all sorts of indigestion remedies and kept myself fully stocked both at work and at home. I actually thought to myself that this was just a fact of life. I’d hit 30 and I was falling apart. Complaining of indigestion is such an archetypal old-man thing to do I just thought I should suck it up and live with it.
The simple one-step programme
I think it was @oatie who, when I complained of indigestion, suggested that caffeine can be a stomach irritant. Fortunately for me, both directors at Magma Digital have been caffeine-free coffee drinkers for years and so decaf is readily available in the office. I made the switch that day and that very night I noticed that my symptoms had eased. There was no acidic pain when lying down and over the next few days, I fell asleep with much less fuss.
I can’t be the only developer who’s been kept awake by a recalcitrant bug. But if that’s happening too frequently for you, then please consider reducing your caffeine intake. I’m not advocating complete removal from everyone’s diet. I still drink regular tea, coffee and coke but at least now I’m aware of how it might affect me. And so are you