Coding As A Substitute For Meditation?
statspotting.com
statspotting.com
Jusy "getting in the flow" is not the point of most meditation.
"[M]editation refers to a family of self-regulation practices that focus on training attention and awareness in order to bring mental processes under greater voluntary control and thereby foster general mental well-being and development and/or specific capacities such as calm, clarity, and concentration" Walsh & Shapiro (2006)
"[M]editation is used to describe practices that self-regulate the body and mind, thereby affecting mental events by engaging a specific attentional set.... regulation of attention is the central commonality across the many divergent methods" Cahn & Polich (2006)
The practice of 'coding in the zone' might as well achieve the same effect as traditional meditational practices and be called meditation on that ground. In fact, you are training the control of your attention with that practice.
A lot of meditation in western countries consists of people forcing themselves to sit and focus, then measuring the amount of time they sat as an accomplishment. It doesn't lead to any long term benefit though, and if really forced, it will actually have the opposite affect.
EDIT: Actually beneficial mediation is something else, and the Tibetan traditions flat out understand it better than anyone, period, they're the Caltech or MIT. Other traditions are ok, but they're not the same caliber.
Flow is the state where it is no longer a struggle to control your attention. What you are paying attention to can require a very active mind.
Mindfulness meditation involves practice at directing your attention, your focus is on meta-cognition. Your breath is often chosen because it requires no attention. It's boring. That makes it good practice at discarding all the other thoughts that come up and focusing your attention back where you want it to be.
Sure, meditation is a broad term but this is at the core of the vast majority of what's called meditation.
Some ideas involve meditation with a goal (considered attainable or just an asymptotic ideal at the end of the direction of improvement) of achieving a state like flow in this practice, so you no longer struggle to maintain your attention on nothing. Apparently extremely serene and calm and peaceful. Sounds wonderful.
Flow is different from meditation, to paraphrase what ramblerman said in another comment: meditation is an exercise of directing attention. Being good at that can help you attain "flow" more easily in other activities.
I know I've found meditation to seem to be good practice for when I want to focus my attention deeply.
Indeed, I would even say such misconceptions are harmful, since coding has quite the opposite effect. After a day of too much or too intensive coding, I usually find that my brain continues to be occupied with coding problems. E.g. when I'm half-sleeping I see problems that don't exist (at least not in sleeping ;)). Meditation has the opposite effect: the mind becomes calm and unoccupied.
It's important to give the mind rest and time to process your day.
The reason people voluntarily stay up late to code, while meditation by contrast seems kind of boring — the reason why people are so eager to come up with different "substitutes" for meditation that just so happen to align with their favorite things to do — is very near the essence of why meditation probably shouldn't be replaced by coding, or running, skiing, drinking, smoking, or whatever your favorite activity is.
It is not about chanting mantras. It is about realization of the "source" of the mental content.)
Calling a concentration, deep focus of so-called state of flow a meditation is confusing misuse of the language (using wrong associations).
Constant agitation and restricted, repetitive patterns of "thinking" is misuse of the mind.)
There is a good chance however that practicing meditation will help you find more 'flow' in your activities.
There is a significant difference though. When you are coding, you experience flow with your mind already full of things. When meditating, you start with an empty mind, so the perceptive influence of flow is far more noticable. It's enough to throw you out of the meditative state if you are unprepared.
The goal of meditation is different than that of coding as well. Meditation starts from an empty mind so that you once you reach a meditative state, you may choose to do any number of things. One exercise the instructor had us perform was to find a meditative state, then meditate on the first thought that entered our mind, and to not sway from that thought.
When you're coding, you are keeping many things in mind. I find that when you end up in the "flow", it is because you have pushed everything out of your mind as a result of there being no space for it. Meditation is about pushing everything out of your mind so there is space for anything.
In the Buddhist traditions meditation is used as a tool to examine the subtle nature of the mind's processes, how they may create suffering through craving, aversion & identification (dependant origination) which initially at least requires some down-time to bring the mind to a relatively quiet state. You really learn a lot about craving when all the goodies are taken away, similarly you learn about aversion from the small discomfort from sitting.
I love coding, it's my main intellectual outlet, but I never want to be someone who has to lug along a laptop on holiday because the pain of being away from code is too great, I take any such pain as indication that I'm broken in some way (addicted). If I simply coded every time I feel that addiction I'd never truly discover how dependant my happiness is on coding & I'd never discover that I can be happy without coding. I think coding is nicer when I'm not addicted to it.
Part of meditation is precisely /not/ doing or thinking about anything. As another comment pointed out, this is sort of finding a substitute for meditation in something most of us would likely being doing anyways, since the majority of us have trouble breaking out of our day-to-day cycle to literally sit for 15 minutes and do nothing whilst so much is going on regardless. I think there are similarities to be drawn in terms of "flow" or getting "in the zone" so to speak while writing code, though.
It seems to me that coding is about actively using a lot of your brain. At the abstraction level of a brain or a mind coding is a whole lot of different things.
I happen to think meditation is good practice for directing your attention mindfully, improve your ability to direct your thoughts. Good at directing your thoughts at something? You'll find you enter flow states when doing it. So I see the connection, but they aren't the same.
There are many ways to reach a state of Flow , coding and meditating may get you there, but as practices I don't think they have more in common than skydiving, rock climbing or surfing a perfect wave..
Personally.. meditating for me is more is like a call to System.gc() on my brain.
Also, years ago when I was studying and had headaches, playing chess against computer was also refreshing. I suppose I was using different parts of the brain and letting others rest.
Coding, when you're good at it and have mastered your tools, IS meditation (at least on the surface) as you feel an intrinsic sense of well-being.