I forgot to eat lunch yesterday.

Writing code for a living can be a bit depressing at times. It has a lot to do with the fact that it’s a sedentary, and often lonely occupation – especially if you work by yourself, for yourself. Lonely hours at a computer screen does wonders for the soul. However, I think it’s important to remember something:

Programming is fucking awesome.

There are a lot of reasons why this is a popular belief. You’re in charge of a system, and you have to make it work. There are elements of problem-solving, challenges, difficult bits, and best of all, new stuff comes out all the time that makes your job easier. What other craft can enjoy those benefits? Not only that: we’re important. We’re put in charge of critical applications. We do things other people can’t. I’ve heard programmers described as tiny gods, which I think is a pretty apt description.

However, to exempt this post from being just another lousy “isn’t programming awesome?” post, I figured I’d explain exactly why I think it’s fun. And when I say why, I mean physiologically. For science!

The best analogy I can give for programming is flying a plane. When you’re flying, you have to concentrate – or else the plane will crash. This means you have to forget about other things, and focus all your attention on keeping the damn thing aloft. You become a part of the process – a symbiosis of man and machine. You have a purpose, and a goal – and everything else is momentarily put aside.

Better yet, playing a musical instrument. If you lose focus, you’ll get something wrong and ruin the performance. It’s very hard to regain your composure after a mistake. I think the same thing happens when you’re building something. If you lose concentration, you’ll lose your train of thought, forget where you are, and have to start all over again. It’s “being in the zone”.

As any Neuropsychology student will tell you, when you concentrate on something, your breathing becomes rhythmic, and your brain’s beta frequencies increase. The funny thing about beta waves? From Wikipedia: “Rhythmic beta with a dominant set of frequencies is associated with various pathologies and drug effects. For instance, beta activity can be accentuated by sedative-hypnotic drugs such as benzodiazepines or barbiturates”. Concentration = hypnosis!

Personally, I think the breathing is behind all of this. Any time you alter your breathing, you mess with your feelings. That’s why you take ten deep breaths when you’re angry. Religion does this; many religions have some form of breath control, be it singing, dancing, chanting, meditation… you name it. Could the entire idea of a “higher power” be caused by misinterpreting the feelings your brain’s activity gives you during measured, controlled breathing? It sounds possible. Funnily enough, the word “spiritual” derives from the latin spiro, which means – you guessed it – to breathe. It’s my favourite theory.

Some evidence suggests that beta waves are good for you, too. This page says “People who have increased their beta Waves have been known to increase their I.Q. and productivity. beta Brain Waves have also been associated as being a natural antidepressant”. Remember, you get paid for this.

The best thing about the trade, as far as I can tell, is that it’s one of the few professions where you get to be “in the zone” for extended periods of time. So much so that we forget to eat, or become oblivious to our surroundings. It’s a little like being in love.

Programming a fairly left-brain exercise – logical and rational, perhaps even robotic. It’s very rare to see creativity and art in programming. _why was an exception, and I miss him dearly. But, in my experience, there’s a real similarity in the feelings between writing some particularly elegant code, and playing a complicated piece of music. Hell, if I didn’t get paid to write code, I’d do it anyway.

When you feel down about what you do for a living, consider this: musicians only get to be “in the zone” for the length of a piece of music. Even pilots don’t get to be “in the zone” every day. I’d be very surprised if business people really get to feel this kind of “in the zone” at all – no matter what they say.

Comments (6)

It's been said that the secret to live longer is eating less—the number of times I forgot to eat/sleep when coding makes me believe I'm up for a long and healthy life!

Yaili_n Inayaili de León (@yaili)
over 2 years ago

Check this out: 'Flow: The Psychology of Optimal Experience' by Mihaly Csikszentmihalyi http://is.gd/47vdB ;]

Ldexterldesign_n Lewis Litanzios (@ldexterldesign)
over 2 years ago

The breathing is so interesting! I never noticed that about myself when I'm in the flow, but you're right, that happens to me every time pretty much.

I used to smoke, and I often attributed the stress relieving effects of it to the fact that all you do is take deep breaths, and make deep exhalations, watching a plume of smoke billow away from you that you created, heh.

Anywho, very awesome article :D

Keith_hanson_n Keith Hanson (@keith_hanson)
over 2 years ago

I wouldn't discount the creative aspects of programming. It may be very left-brained, but as someone who's a designer, and grew up playing music, yet really enjoys programming too, I can say this: the act of programming feels very different from nailing a good design, but they both feed my soul in the same way.

Gblakeman_n Grant Blakeman (@gblakeman)
over 2 years ago

To whether musicians get to be in the zone, have you forgotten that most of our time is spent practicing rather than performing. When practicing, it is rare to play a piece all the way through; we are instead focused on problem-solving, which can take hours. Carry on.

Wockerjabi_n wockerjabi (@wockerjabi)
over 2 years ago

This is spot on. I will point the next person who asks me "how can you actually enjoy coding?" to this post.

Typasch_n Tyler Pasch (@typasch)
over 2 years ago