Caffeine and Code: Not always the best combination

David Nash General Leave a Comment

I have a secret: I don’t drink caffeine at all. It’s been about a year now and I don’t think I’ll go back.

I know: coders and caffeine go together like two sequential elements in an array. Every programmer I know drinks coffee, and a lot of it. I was the same. A cup in the morning and a cup just after lunch. Sometimes more. I’d always done it. I needed it, but I was never really sure if it was actually helping.

Sure, it would take away the exhausted feeling for an hour, but it would come back even worse. I’d get jittery and it my attention would be all over the place – write a line of code, check email, reply, wander around, try to focus on code, get distracted, repeat.

I think the worse thing was that I’d get very frustrated. Most of a programmer’s job is trying something, having it fail, and trying again until it works. When there’s a tight deadline that can be very stressful. Being jacked up on caffeine doesn’t make that any more pleasant.

Now that I’m caffeine free it’s much easier for me to get into the “zen” of coding. I still get frustrated occasionally but it’s perhaps once every couple of days, instead of basically all the time.

And because of this, working is much easier. I used to find it physically draining. My eyes would hurt from strain, my body would be tense all day as I struggled with problems and tried to focus.

Now, everything’s just easier. I half expect that most of what I do won’t work, and when it does I’m pleasantly surprised.

This means I can actually work for much longer, and the quality of work is much greater. Instead of sprinting and tripping over myself I’m taking nice, long walks – and getting much further.

I’m no longer on the up and down rollercoaster of caffeine. My sleep, while not perfect, is much better, and much more consistent. Which makes for better code.

I’ve found it’s had other effects too. I find that when I’m tired and irritable I eat more, and I eat worse. Being well rested means I’m happy to eat less, and eat healthy.

Sometimes I’d be so wired and stressed from working all day I’d need a stiff drink or two at night to calm down. That didn’t help my sleep either, so I’d wake up and need more coffee to keep going.

Biology is a wonderful thing. Organisms adapt to their environment. So when caffeine is constantly in your bloodstream the brain just adapts to it, and it’s not as effective.

So how did I do it? I cut down to one cup of coffee in the morning. Then two cups of black tea per day. Then one cup. Then green tea. And that was the jumping-off point. It wasn’t really that difficult. Instantly I was sleeping better. The more time I put between me and my last caffeine hit, the easier it became to resist the urge.

There are still times when I’m just exhausted. I did once try a cup of green tea, hoping it would have full effect again. I guess it did, but the effect just was to add energy to the grumpy exhaustion without actually making me feel any less exhausted.¬†Caffeine is a powerful stimulant. We just don’t notice because we’re all so hooked.

I’m very fortunate in that I work from home most of the time. When I really need it, I might have a nap after lunch. It’s very pleasant and so much more refreshing that caffeine.

Do you use caffeine as a tool or has it become your master? If you use it habitually and finding it’s not working like it used to, I really recommend taking a break. Even if it’s just a temporary break, caffeine will be so much more effective when you go back.

Leave a Reply