Skip to main content

IF YOU'RE A CODER, EXERCISE IS PART OF YOUR JOB.

If you're an elite footballer, cyclist or Hollywood star, part of your weekly routine probably involves hitting the gym. You're not paid to go the gym- you're paid to play football or repeat lines for £10,000 a word. However, you can't be a great athlete or (these days) a Hollywood star if you don't maintain a high level of physical fitness. Though the link may not be as obvious, I am going to argue that:
To be the best coder you can be (or any kind of knowledge worker) you need to exercise regularly.
(Before I'm accused of insensitivity, I'm not arguing that those unable to exercise due to disabilities can't be great coders. To claim that, I would have to be ignorant of people like Stephen Hawking. I am only making a general claim (i.e. 'on average'))

I'll assume you already know about the benefits of exercise for your health in general, so we won't talk about the benefits of exercise in reducing risk for conditions like heart disease and diabetes. Instead we'll focus on the purely cognitive effects of exercise. These include things like attention, short and long-term memory, reasoning and other executive functions. 

The link between exercise and learning has been growing stronger over the past few decades. Much of the early research was conducted in dementia patients - exercise has been shown to slow and partially reverse the cognitive effects of age-related dementia. More recently, scientists discovered that neurogenesis (the production of new neurons) still occurs in adults, whereas we used to think that neurons produced in childhood were all we had for the remainder of our lives. This discovery has given extra impetus to research into ways of enhancing neurogenesis in adults. A robust finding of the past few decades has been the positive effect of moderate exercise on learning  (just google 'exercise and learning' to read some recent articles on the subject.)

Let's focus on an excerpt from this paper:
"Optimal brain health throughout the lifespan is promoted by intermittent challenges such as exercise, cognitive stimulation and dietary energy restriction, that subject neurons to activity-related metabolic stress. At the molecular level, such challenges to neurons result in the production of proteins involved in neurogenesis, learning and memory and neuronal survival;..."
Of the three challenges noted in this quote, coders usually encounter enough cognitive stimulation in their job. (However, if your job involves mindless routines with little opportunity for problem-solving, you may want to start doing a morning Sudoku). The effects of dietary-energy restriction are interesting, though how to implement it effectively requires more research. (You could skip lunch everyday or fast a couple of days a week, but if that makes you tired and grumpy then that isn't a benefit. Anecdotally, I know that eating a large, healthy breakfast helps me think more clearly throughout the day, and that hot lunches make me sleepy so are to be avoided. Find what works for you best.) 

Before we look at the details of the link between exercise and brain function, let's pause to consider why this link might exist. As the above quote suggested, the brain responds to 'challenges', specifically metabolic challenges. In other words, exercise induced oxidative stress, limited caloric restriction (basically, slightly starving your brain) or simply 'thinking really hard' (which can use up brain glucose reserves) force your brain to respond, just as a muscle responds to the stress imposed by lifting weights. Well, we don't actually know why this is the case, but we can construct some pleasing 'just so' stories that work. 

Imagine your ancestor on the African savannah. Other than reproducing, her main goals in life are to find food and not to become food herself. Her brain is her best tool for accomplishing these goals, and it does its work efficiently. Learning (meaning the formation and survival of new neurons and new neuronal connections) occurs when it will help her find food better in the future or escape potential dangers. If she has gone several days without food (dietary energy restriction), her brain is primed to look for new food resources. When she does find food, her brain effectively says, 'Right, let's not forget that food source so we don't go hungry again.' When she has been running away from a lion (exercise) her brain says, 'Remember what led you into that situation and avoid it in future.' (Scientists have found different effects for voluntary and forced exercise, which we'll consider below. Running away from a lion probably counts as forced exercise.)  Alternatively, if she were safe from all predators and had all the food she needed, her brain would say 'Right, job done, switch off and eat.'

In our present environment, few of us ever encounter predators or even go hungry. We therefore need to simulate these conditions by voluntarily exercising and thus triggering the same learning response in our brains.

To return to the excerpt, exercise seems to encourage neurogenesis (growth of new neurons). It also increases learning and memory (which involve connections between neurons). Lastly, it seems to encourage neuronal survival. It seems that, if you don't use the new neurons produced through exercise, they die. That's why it's important to combine physical exercise with mental exercise (again, if you're solving novel problems at work on a daily basis, you don't need to download the latest BrainGym app.) Other studies have found positive effects of moderate exercise on learning new foreign language words, recall of text passages read, and performance on problem solving tasks (possibly due to increased attention span). 

One finding to note (which needs much more research) has been that extreme exercise may have the opposite effect on brain function. One study on marathon runners noted impairment in their explicit memory (the memory you use to recall things vs 'implicit memory' which is involved in more unconscious tasks like driving a car.) It may be that the increased cortisol levels experienced during excessive exercise have an overall negative impact on learning and brain function. So I'm not suggesting that everyone takes up marathon running- instead, consider the typically recommended 150 minutes a week of moderate aerobic activity with a few strength training sessions thrown in.


'OK, but  I'm already a great coder - why should I have to exercise?', you may ask. That's a question you'll have to answer for yourself. If you're content with your performance and would rather lose a foot than take up exercise, then that's your choice. If you would like to explore how much better you could be as a coder, then start exercising.

Does this mean that knowledge companies should require their employees to exercise? Ignoring the benefits to their health insurance costs, would enforced exercise be benefical for productivity and the general quality of coder's work?
Probably not.
In most animal studies, enforced exercise had a nil or negative impact on learning and brain function as it increased stress levels (meaning more cortisol in the bloodstream).
So, someone exercising at gunpoint (or at least under the threat of losing their job), would not experience the beneficial brain effects of voluntary exercise.

In conclusion, as we become more desk-bound and experience fewer lion chases every year, we need to artificially stimulate our brain's learning pathways through regular exercise. If you're a coder, exercise should be seen as part of the job description just as it is for an athlete.

Comments

Popular posts from this blog

Einstein's Logic Puzzle (SPOILER ALERT!)

On Monday I began working through a Discrete Math textbook in preparation for some courses I'll be taking in January. There was a beautiful logic problem in Chapter 1, apparently created by Einstein. This is one version of it: Five men with  different nationalities and with different jobs live in  con secutive houses on a street. These houses are painted  dif ferent colors. The men have different pets and have   dif ferent favorite drinks.  Determine who owns a zebra and  whose favorite drink is mineral water (which is one of the  favorite drinks) given these clues:  The Englishman lives  in the red house.  The Spaniard owns a dog.  The Japanese  man is a painter.  The Italian drinks tea.  The Norwegian  lives in the first house on the left.  The green house is  immediately to the right of the white one. The photogra pher  breeds snails.  The diplomat lives in the yellow house. Milk is drunk in the middle house. The owner of the green  house drinks coffee. The Nor

CodeSchool vs Codecademy(or 'How socket inherits event listening methods and implements asynchronicity')

In this review I'm going to focus on the pedagogy that I see evident in some CodeSchool courses and compare them to  Codecademy. By pedagogy, I mean: 'How does CodeSchool teach?' and ' Does it do a good job of teaching?'. I'm going to argue that despite high quality videos, colourful web pages, and often ssspppeeeeeakkkiiiing...rrrreeally...slowly..., CodeSchool's pedagogy is inferior to that of Codecademy. There are many fantastic resources for learning to code on the web, and CodeSchool is one of them. So far I have completed courses in Ruby, Rails, Javascript, HTML/CSS, Jquery and Git on CodeSchool. The courses have all included high quality videos and colourful, interactive exercises- as well as  massive  pdf files of the slides ( the files take more than a minute to load on my machine .) The question is: does the higher production value mean better educational quality? The 'Try' courses on CodeSchool(such as Try Ruby and Try jQuery) are f

Ruby on Rails -First App

Yesterday I built my first (technically second) Rails app working through Michael Hartl's book . The 3rd edition is free to read online and has been recommended by several self-taught developers; it is also on The Odin Project curriculum. The first tutorial covers the basic installations, including Git, Heroku and Bitbucket (instead of GitHub). The steps are clear, but the language sometimes is not.  Most of the steps worked -except that my app doesn't seem to work when accessed from Heroku.    When running bundle install, I ran into problems with the SQL gems. Apparently this was because Ubuntu14.04 didn't come with the C compiler needed.  I needed to run:                                sudo apt-get install libsqlite3 -dev                                sudo apt-get install libpq -dev             After this the bundle install  went ahead fine.    I also finished CodeSchool's Rails for Zombies which introduced basic Rails. As a review, I'm now worki