The Ultimate Guide to Mindfulness for Programmers
You may think that the concepts of “mindfulness” and “programming” are worlds apart – and you’re right.
Programming is something that involves computers, compilers, apps and cold, hard analytical stuff. Mindfulness, on the other hand, is a spiritual practice, a religion for some, and it happens entirely in your head.
So, why discuss mindfulness in programming? Let’s find out.
- “I’ll Never Get Good At This!”
- Always On The Lookout For Solutions
- Anxiety At Work
- The Path Of The Warrior
- Further Reading
“I’ll Never Get Good At This!”
Programming is inherently human. We developers, we write code. We learn about concepts, principles and practices that are useful for building software. We have hopes, fears and desires. We have professional goals, like becoming a senior developer, and personal goals, like publishing our first app in the App Store.
At one point in your life, you wrote your first line of code. Maybe it didn’t work rightaway and you thought: “I’ll never get good at this!”
A long time ago I learned iOS development with a book called Sam’s Teach Yourself iPhone Application Development In 24 Hours. Following the exercises in that book was part of my plan to successfully build my first app – a client’s app, actually.
There was one thing I couldn’t get right. In order to distribute the app to an iPhone device, or the App Store, the “entitlements” file needed a setting called
get-task-allow set to on or off, and it was unclear to me which was needed.
I wasn’t on the clock, but there certainly was pressure. I had accepted this client project already, so if I didn’t succeed at learning iOS development I’d have to give up, miss out on a payday, and admit defeat. Of which admitting defeat definitely was the worst…
So, I panicked. Thoughts raced my mind. Mindfulness was as scarce as an oasis in the desert. Maybe you’re familiar with some of these thoughts:
- “I’ll never get it right!”
- “I’m just not good enough.”
- “I’m missing something important here.”
- “I’m just not smart enough.”
These thoughts definitely didn’t help. They didn’t necessarily make me feel bad – although they did – but they clouded the insight, clarity and calm I needed to solve the problem at hand.
It’s like trying to race a car on a race track, while someone is constantly pulling your steering wheel. And the more you resist, the stronger the pulling becomes. As a result, I suffered more than I needed to.
Always On The Lookout For Solutions
A typical programmer joke involves Google and StackOverflow. It’s said that we spend half our days looking for solutions to programming problems on StackOverflow, and the other half of the day trying to adjust the copied-and-pasted code until it works.
Whether that’s accurate or not is beyond the point – the sentiment is striking: we spend a lot of time solving problems. Our desire to finally solve the problem is so great, that you’ll often read comments on StackOverflow that say: “THANK YOU!!! I spent 2 days on this, and your solution finally worked!”
Imagine the pain and suffering this person must have felt, toiling away, trying different answers, code snippets and solutions. And when the problem is solved, they finally reach a place of calm and peace – until the next bug, that is. It’s hardly mindful…
OK, maybe it’s not that bad. Developers take pride in solving hard problems, and doing things that may not seem possible at first glance. As a matter of fact, we often give beginners the advice that they should get used to spending at least 50% of their time on debugging and refactoring. It’s simply part of our work ethic.
It’s entirely possible that you enjoy solving problems. I know I do. It’s what makes development interesting, challenging and meaningful. Being in a “flow state” is an approach to mindfulness, too.
But it’s also likely that you resent being in a place where you don’t want to be. Your boss or client is breathing down your neck, because you’re holding up the project with an unfixed bug. You’re working overtime because a webservice crashed, and you have no idea why. Your app isn’t gaining traction like you hoped or expected.
It’s only logical that you desire to be somewhere else, and that’s the antithesis of being mindful.
Anxiety At Work
This continual suffering from destructive thoughts, and desiring to be somewhere else, is tiring. It hurts what you value most in life, like your happiness or productivity, and for some people it even leads to anxiety and depression.
You feel that they’re in a hole in the ground so deep, that there’s no way to get out. You dread getting out of bed in the morning, going to work, and living through the same hell all over again. And that sucks.
Anxiety in the workplace is real. It doesn’t happen to all of us of course, but my gut tells me that with the pressure we put on people, and how we’re always striving to be a better version of ourselves, anxiety and depression are becoming bigger problems. And even if I’m wrong, I’d say that one more panic attack for someone out there is one too many.
If you’re struggling with anxiety or depression, and you feel that you’re unable to deal with it, ask for help. Pick up the phone, call a friend, or make an appointment with your GP or doctor.
The Path Of The Warrior
Anxiety and depression may not be real for all of us, but feeling that we don’t quite measure up certainly is.
I bet you know that feeling that creeps up on you, that little voice in your head that tells you toxic lies like “You’ll never get it right! or “You’re just not good enough.”
What’s helped me most in dealing with tough times, is the idea that there are a lot of people out there going through the same thing. It’s a shared condition. And when you look compassionately at the suffering of others, you may feel a little bit more compassion for yourself.
Mindfulness is the act of just sitting with anything that arises in your mind. Negative thoughts, like feelings of guilt, shame, loss, anger, sadness or regret – or just that incessant idea that you’re not quite measuring up.
It’s not about silencing bad thoughts, or only letting the good ones through. It’s not about escaping to a place that’s full of bliss and happiness. It’s more about getting at ease with whatever comes up, seeing it, and letting it go.
A great way to practice mindfulness is by meditating. Some people focus on their breath during meditation. For others it’s a way to stand still for a few minutes, in their busy lives. For myself, it’s a practice that helps me not to get too caught up in thinking.
It takes guts to sit down and meditate. You may discover that this place where you are now is a really crappy spot to be. But it’s where you are right now, so you might as well be here fully. And that may give you the calm, clarity and space you need to go some other place.
A great place to start your meditation practice is with Headspace. It’s an app that has guided meditations, from Andy Puddicombe, and the first 10 meditations are free. It’s perfect for just trying it out, and see if it works for you.
I want to conclude with a story that I first heard from Pema Chrödrön, and it goes something like this:
Life is a lot like walking into an ocean. As you’re walking, a big wave comes and knocks you over. And you get dragged under, lying on the bottom of the ocean, with sand in your nose and in your mouth.
You got two choices now. You can stay there – which isn’t really an option – or you can get back to the surface and start walking out to sea again.
And as you walk, a big wave comes and knocks you over. Again, you’re at the bottom of the ocean, and you have a choice to stay there or to get up and start walking out to sea again.
As the waves keep coming, you cultivate your courage, bravery and sense of humor to relate to this situation with the waves, and you keep getting up and moving forward.
And after a while, it will begin to seem to you that the waves are getting smaller and smaller. And they won’t knock you over anymore.
Code Swift right in your browser!
Go to the Swift Sandbox