DEV Community

Cover image for A dev's guide to meditation - part 1
Daragh Byrne
Daragh Byrne

Posted on • Updated on • Originally published at codingmindfully.com

A dev's guide to meditation - part 1

This is a serialisation of a guide to meditation for programmers that I first posted over at CodingMindfully.com. If you can't wait for the full series to be published, head on over and download your free PDF copy!

(Photo credit - Hannah Wei via Unsplash)

Meditation, programming and YOU!

Why I wrote this guide

My mind has malfunctioned in spectacular fashion on a number of occasions (thankfully, and mostly thanks to the techniques I describe here, not for a while!).

It’s hard to write code with a malfunctioning mind.

For me, those periods of malfunction were the result of excessive stress in my life. They showed up as the symptoms of extreme anxiety - a constant worry I wasn’t good enough, fear about the future, muddled, excessive thinking, insomnia and so on.

If this sounds like you, there’s a good chance that some of the stuff here might be able to help. I’m not a therapist though, so if you suspect some deep underlying mental health stuff, seek one out - I’ve done it several times and am a better human because of it. No shame. Please email me if you want help with this – daragh@codingmindfully.com.

I’ve navigated my way out of those malfunctions several times. In fact, my life has improved in a few significant ways since those experiences.

I went from stressed, anxious and unfocused, unable to write code and barely able to do my job, to happy, light-hearted and focused, working on projects that I care about and with a newfound capability to deliver.

None of the tools I’ll explain here are complex or mystical. All are practical and require not much more than somewhere to sit quietly for a few minutes.

Is this guide for you?

If you’re a programmer or write code in any part of your professional or personal life, this guide is aimed squarely at you. It’s based on some simple premises:

  • You use your mind to write code;
  • All skills and capabilities can be improved with training - you have already done this many times in your life;
  • It’s possible to train certain capabilities of your mind - in particular, concentration, and the ability to be aware of, and alter, your mental state - which will help you become a more confident, capable coder.

The main method of mind training I explain in this guide is commonly referred to as “meditation”, although you might find it helpful to think of it as “attention regulation training” - that’s basically what it is. The capacity to focus your attention is, I’m sure you’ll agree, crucial to outputting quality code, so it’s in your interest to train it.

Why programmers benefit from meditation

Consider these scenarios. If you’ve been working with code for any length of time, you might have encountered any of these.

Scenario 1

You just can’t figure out what’s causing this bug. Countless hours of Googling, numerous Stackoverflow blind alleys, every reverse engineering trick you can think of, every single package removed and reinstalled, one by one – this thing still won’t work. You start to think you’re not cut out for this coding life. It’s frustrating and you feel like a fraud – surely your co-workers will figure out you’re just a dumb impostor any minute now. It’s a lonely place, and fear piles on frustration – fear that you’re out of your depth, that you’ll never be any good at this. What good will mastering this technology do anyways? There will just be another one to learn, it’s impossible to learn. You’re just running to stand still.

Scenario 2

It’s retro time. You’re sitting in the meeting area, waiting for your demo, palms sweating, fearful of what’s to come. You hate showing your work. What if they don’t get it? What if it doesn’t work? What if your voice breaks? Will you be able to answer their questions? They’re a demanding crowd, asking so much all the time, it’s relentless. Why do they keep asking so much of you?  

Scenario 3

You arrive home after another long day at the code mines. While you definitely made some progress, you’re finding it hard to shake off the day. That one problem you couldn’t solve is going around in your head. It’s hard to think of anything else – when you close your eyes, you can just see code. The clack of the keyboard has burrowed its way into your mind. There’s a steel rod where your shoulders should be, and when you try to sleep, the buzzing of your mind keeps you awake. Tomorrow doesn’t sound like much fun right now, although it might be better if you could just get some sleep…

Or these quotes, taken from several regular programmers who I spoke to while compiling this guide:

“I study coding and work as a programmer on my startup. Meditation helps me when I’m feeling overwhelmed and overloaded with information. It’s silence away from the noise of other humans, online courses, podcasts – a chance to let me brain rest for a while and just stop working”

“Meditation relieves the CRAZY amount of stress I find myself under and once I’ve released some of that stress it re-energises me – often it’ll help me get to sleep if I can’t drift off and all I can see is code behind my eyelids”

“Breathing meditation helps be come back into the present. I’m doing exams for my programming courses in university right now and meditation brings me almost immediate calm when I need it most”

“Sometimes my mind makes the challenges of writing code bigger and scarier than they actually are. When I meditate, it’s like the problems come back down to actual size and I realise that they aren’t actually that big – it’s a perspective shifting tool”

“Sometimes when I’m frustrated I can be a real asshole to my colleagues and family. This doesn’t do anyone any good. Meditation helps me to make peace with my circumstances so I don’t take it out on others. I feel more emotionally balanced, and I’m able to focus on the code instead – which is what I’m really here to do”

There are several big reasons to meditate if you spend any time writing code:

  • Meditation helps you stay focused and effective by training you to work with with inner and outer distractions;
  • Meditation mitigates the effects of stress by teaching you how to relax;
  • Meditation helps with FOMO (fear of missing out - for example, being left behind because you don’t know everything about latest, greatest, all conquering Javascript framework) and impostor syndrome (“I’ll never know enough to not be a fraud; I need to work super hard to be considered barely competent”) by teaching you to be present to your current experience and capabilities rather than unnecessarily dwelling in the past or future (sound familiar?);
  • Meditation helps you deal with unhelpful, reactive emotions like frustration and anger;
  • Meditation helps with creativity and problem solving.

Meditation as focus training
Anybody who has ever written any code knows it requires focus. Getting knocked out of flow can ruin your productivity. But distractions are real and have a huge negative impact on getting things done.

A programmer can take ten to fifteen minutes to start editing code after an interruption [link]. By learning to recognise the distracted or interrupted state, it is possible to get yourself back on track more quickly.

Distractions come in two forms - external and internal. External distractions are to do with other people and the world around you; internal distractions to do with your own inner world - the world of thoughts and emotions.

Meditation helps you to work with distractions in two ways:

  • You generally become less agitated and more able to cope with external distractions in a non-reactive way
  • You learn how to navigate your own inner distractions of frustration, fear, anger and not-feeling-good-enough by learning how to observe when they are taking you out of focus, so you can bring yourself back on task.

Meditation as stress relief
The stress response is a response in the body-mind system in relation to a perceived threat. I wrote a long, detailed article about stress here.

The short version is - while a little stress isn’t harmful and can even be beneficial, chronic, long-term stress is a productivity killer and really not good for your long-term health, or how you feel about the world in general.

Some of the strongest scientific research into meditation supports its effectiveness as an antidote to stress.

Meditation trains you to be present
The most important moment in your life is the one that you are living right now. The past is done, the future is uncertain and hasn’t quite appeared yet.

Our mind, however, often feels it would like to be anywhere BUT the present moment.

We’re constantly wishing we were somewhere else or someone else. We dream of futures where we have all the answers; or that we are the World’s Greatest Coder (I’m still waiting for my medal!). We remember easier times, or harder times, or any time that isn’t right now.

While the desire for improvement that this creates can be beneficial when it comes to providing momentum to improve our lives, when we’re caught up in this type of future or past oriented thinking, we’re missing out on all the goodness of the life that we’re living right now.

Us coders are lucky, in that the vast majority of us LOVE writing code. But we are still subjected to that nagging feeling that things will be better IN THE FUTURE or things were better in the past.

For example, the nagging feeling of being an impostor - that somehow, the current version of ourselves is somehow not good enough, that we’ll be found out as not having the right skills, that our knowledge is incomplete.

In either case, we wish for a future version of ourselves that will be better, rather than focussing on how amazing we actually are right now. Which means we’re missing out on that most important moment - right now.

For most of us, there are AMAZING aspects of our current situations that we’re missing out on by just not paying attention, or by giving these not-now thoughts way too much value!

Furthermore, a good programmer is deeply in touch with the ability to spot potential problems. The capacity to anticipate issues is a strength when applied judiciously - but humans are already up against a negativity bias - where about 80% of our idle mental effort goes towards pondering negative situations.

At worst, the thinking mind of a programmer can become problem saturated, leaving no time or space for joy or fun or ease. Which is no way to live!

By teaching us to be present, meditation allows us to savour and enjoy the life that we are actually living rather than the imaginary life our mind is constantly creating or fearing. The moment by moment experience you are currently having becomes richer, more detailed and more meaningful.

Your interactions with friends and colleagues can become lighter. Your capacity to stay calm under pressure. Your ability to show up for this life, lived right now, in this moment, is enhanced.

Why are you reading this guide?

I want to help you stay on track here. Something got you to click on the link and start reading this guide.

It might be that you have some difficulty that is getting in the way of you being able to write code.

Perhaps that difficulty has been there for a long time, perhaps it’s more recent.

Often it’s related to difficulties focusing, which in a large number of cases is to do with excessive stress.

Perhaps the code is flowing from your fingertips, and you want to keep it that way. You’ve had periods of struggle before and are curious about how they might be avoided or minimised.

Or it might be that you are already smashing it in life, but want to level up in some way.

It might be plain old curiosity. Perhaps someone you trust told you that meditation would be useful to you.

Whatever it is, make a mental note of it right now. Perhaps write it down on a piece of paper. Keep it somewhere you can see it. Whatever you take from reading this and trying out some of the techniques, you’ll be able to assess whether it has been useful for you.

If it’s useful, keep doing it. If it’s not immediately useful, stick with it before making your mind up completely - most good things take a little time to figure out.

Do this now

To give you a flavour of what to expect in this guide, take a few minutes to do the short exercise in this video.

How do you feel now? What do you notice about your breath, your mind and your body? Many people report feeling calmer and more focussed after just a few minutes of this type of breathing.

Stay tuned for Part 2.

This is a serialisation of a guide to meditation for programmers that I first posted over at CodingMindfully.com. If you can't wait for the full series to be published, head on over and download your free PDF copy!

Top comments (6)

Collapse
 
jeffblanco profile image
JeFFBlanco

Thanks for putting this together, man! I've been practicing meditation for about a year with the help of Headspace. It's amazing how taking some time out of your day to practice mindfulness can go a really long way toward getting a "Malfunctioning Mind" less jumbled.

Collapse
 
codingmindfully profile image
Daragh Byrne

Headspace has done wonders for mainstreaming meditation. Yes, you don’t need much to see results. What would you say has changed most for you as a result of your practice? What would you like to know more about?

Collapse
 
jeffblanco profile image
JeFFBlanco

For me the biggest benefits have been an improved general awareness -- particularly, realizing how much we do both mentally (thoughts and emotions) and physically (things as simple as changing from standing to sitting, sitting to standing, opening a door etc..) on auto-pilot. I've found exercising the mind in these areas helps me become better aware when I start getting wrapped up too deep in a thought or emotion.

I'm interesting in learning more about everything :)

Collapse
 
timothymcgrath profile image
Timothy McGrath

Great post. I use Calm for a daily meditation and it always leaves me feeling more relaxed.

Collapse
 
codingmindfully profile image
Daragh Byrne

Excellent. Glad to hear. I really notice those times in my life when I've let meditation slip. It's such powerful practice!

Any other benefits you've noticed?

Collapse
 
timothymcgrath profile image
Timothy McGrath

Probably like many developers, I trend to get caught in a loop of overthinking or worry. It helps me solve hard dev problems but it also stresses me out. A meditation break helps me break out of it.