Coding Super Skill Series Part 1: Meditation Practice

How to Use Meditation to Fuel Your Coding Journey

Shane McGrath
CodeX

--

Photo by Ashley Batz on Unsplash

In the Super Skill series, we will explore powerful non-coding skills that will help support and fuel your coding journey. Today we will discuss meditation and how to implement the practice as a software developer.

Flow State and Meditation

While meditation has multiple benefits for software developers, the most valuable gift derived from training the mind is achieving a highly optimized mental state of being. As you can imagine, a powerful and clear mental state is prized by the software developer facing the cognitive feats of dexterity it often takes to design, develop, refactor, problem solve, and ultimately produce good code.

While this mental state is highly sought after in the pursuit of peak performance, it can be difficult to achieve.

Why is that?

In this era of information overload, overwhelm, and unease, we are bombarded with challenges and as a default tend to inherit non-resourceful mental states which often show up as learning and productivity obstacles. Have you ever tried to code when you weren’t quite feeling 100%? It can be downright impossible.

When we are able to transcend the challenges of daily life and optimize our brain, we can achieve what is known as a flow state. Flow and meditation are intimately connected. Flow state has been carefully studied by psychologists and performance specialists and has been written about extensively. If you are interested in diving deeper on the topic, a great place to start is with the brilliant works of psychologist Mihaly Csikszentmihalyi who pioneered the this exciting concept.

The flow state is powerful. In a state of flow, one loses sense of time while being able to produce and execute at a very rapid but seamless pace. This is incredibly useful for software developers and can help you gain an edge in your own work. Playing a really fun video game is a great example of flow state being invoked (to borrow a JavaScript term). You play the game in a way where you become one with the controller, mind and action totally aligned. You speed along as the hours pass and you achieve results at an incredible pace. Nothing else matters, you are truly one with the game.

Meditation can help you more consistently produce this flow state, even when the daily demands of living are working against you. Because coding is such a methodical practice requiring concentration, patience, and is very process oriented, meditation and the flow states which come from it are beautifully compatible with this type of work.

The optimal state of mind for developing code can be achieved repeatedly with a daily meditation practice. So how do we implement meditation?

How to Get Started With Meditation: 15 Minute Practice

There are many ways to meditate and techniques you can learn, but lets start simple. I’ve been meditating for 11 years and find this method to be the most accessible and least complicated way to practice. Additionally, by making the practice easy, you’ll be compelled to try it again and again, which builds the habit and increases the benefits.

Step 1: Find a comfortable place to sit

I personally love my ottoman couch at home, or even right in my office chair.
While it’s often recommended to maintain a perfect balanced posture during meditation, I find it easier to dial in the next steps outlined below and revisit improving posture at a later time once you’ve built the habit into your routine. Zen Buddhists would likely argue me on this point and stress right posture before starting, but I personally like to stack on the details over time.

Step 2: Set a timer on your phone for 15 minutes

I like to place the phone far away. This is because the sound of the alarm can be startling if too loud or too close to you when it goes off. You can of course meditate without a timer, but I like to use a specific increment of time and train myself within the same duration over and over. Using defined time intervals is a lot like weight training, where you perform a defined number of reps, which helps build muscle memory and dial in the repetitive discipline of the practice. Repetition will fuel your meditation benefits, you’ll likely realize more and more as your practice unfolds over time. A single session will not produce all the benefits you will ultimately experience.

Step 3: close your eyes

Sometimes if my eyes are strained or I have a lot of body tension, I may rub my face, jaw, and eyes to loosen up the muscles a bit.

Step 4: Take slow deep breath in, and deep breath out. Repeat through entire session

The goal is to pay attention to the flow of your breath instead of your thoughts. This sounds simple, but is actually one of the parts of meditation that requires the most practice. You will want to hold your breath for a moment before releasing. Pay attention to the hold and release of a breath out, as well as the slow deep draw of the new breath in.

Over time, concentration on the breath releases compulsive attachment to your thoughts. It can be difficult to describe how beneficial this can be, and is something you should experience directly to really understand and appreciate. You’ll begin to notice relaxation often with only a few repetitions of breath, but don’t rush it. There is no race, and there is no finish line with this work.

Step 5: Observe your thoughts and let them pass by

You will find it nearly impossible to stop thoughts and fully blank your mind and don’t worry too much about it. Our thoughts are often compulsive and beyond our control, something you’ll begin to awaken to as you practice.
The point is not to punish yourself for having thoughts, but rather to learn to watch them go by and detach from them. This too takes time to experience and learn but once you get a handle on it, you may be amazed at how more clear and sharp your thinking becomes.

Step 6: End your session
Once complete, your alarm will go off and you will conclude the practice. I like to ground myself and ease back into the day after meditating. One way to do this is by having a small snack or a bit of coffee. This helps one depart the session feeling grounded and ready to once again face the day.

How Meditating Feeds Into Coding Activity

Now that you have an easy practice at your fingertips, lets examine some of the benefits you may expect as it relates to coding activity. Here are several benefits that I’ve observed:

Train Attention and Concentration

When you hear coding advice such as “You just have to focus,” it oversimplifies what it means to concentrate and you should discard it. It is more effective to view focus as something you can hone and improve over time, and to go slowly and gently towards the pursuit. It is not a simple switch you can flip on and off. In some cases, heavy training is required to achieve a higher degree of focus and that’s okay.

Meditation is a great tool at your disposal for this type of training. This allows you to get more out of your time by syncing up your thought with your output. Sometimes trickier syntax and work with algorithms requires more forethought. I have found that training my concentration prior to tackling a more difficult task in web development, especially JavaScript, has worked better than jumping into the code right away.

Detachment From Outcome

We are all often very outcome dependent. When we code we want to get to the finish line and solve the problem. To be fair, it brings a feeling of satisfaction which is motivation for the inevitable next challenge. I felt this especially as a brand new software developer learning the basics. I wanted to prove to myself I could complete something. Often I would rush through a project just to feel the gratification of finishing, only to realize I executed sloppy code and had to refactor.

Finishing a task or project varies depending on which programming language you work with or scope of the project or task. It can be a complete application running without bugs, or even a single block of code requiring error correction or refactor. Sometimes we get so hung up on wanting to solve the problem, it sends us into a frantic and non-resourceful state. We start thinking about how we just want to be done. Instead, we would benefit from enjoying the process and tuning into it, setting aside the finished goal. Meditation helps you achieve a detached state of mind which allows you to work more patiently with the intricacies of your projects.

Stabilize the Mind

Like many of you, coding is not my primary occupation. I work on projects in the evening, after a long day at my full time job which taxes my mental capabilities. Further, the obligations of the day can leave me worrying about concerns irrelevant to my current coding project, which makes it hard to show up and do good work.

Meditation is a great way to ease the worries and fatigue of the mind. I get the most out of meditation when I meditate right before jumping into coding work. It is a great warm up and I feel more even and balanced going into the work. Usually I do my best work with this meditate then code process.

More Creativity

Creativity shows up in software development in an interesting way. Coming from a background of writing and performing music, cooking, and other creative activities, coding hits different. On one hand, there are clear rules, structures, and often sequence to how code is prepared, compiled, and executed. On the other hand, there are big unknowns and opportunities to create opportunity and produce new and interesting software applications.

Meditation is great for the unknown because it teaches you over time to be patient. It trains your ability to rest and ponder in hypotheticals when the path forward isn’t clear. From this place of stillness, new ideas and insights can rise to the surface. Further, being able to at first examine your mind from new perspectives once you detach from your default thinking, eventually leads to being able to examine your coding challenges from new angles. This can be incredibly powerful for the software developer to produce new innovation and fresh thinking for the challenges we face, or simply as part of the debugging process.

Closing Thoughts

I would like to leave you with a word of caution. The set of benefits should not be considered as comprehensive. As you practice, you’ll realize the benefits can be difficult to put into words, much like the dreams we have at night can be hard to describe. Through your own practice, you may discover entirely different benefits relative to your own situation. I hope you consider embracing the practice and would love to hear how meditation has benefited you. Happy coding!

--

--

Shane McGrath
CodeX
Writer for

I help technical/creative professionals master productivity and deep work to build prosperous and rewarding careers