Better living through greenery

What do you need to be a good programmer? Leave aside the syntactic trivia for the moment – what mental qualities do you need? I’d say a good developer needs to:

  • focus
  • think fast
  • have good working memory (the ability to hold more in your mind at once)
  • have good long-term memory (so you’re not reading StackOverflow answers all the time)
  • have self-confidence (to be bold in making changes and during discussions).

These are all affected by your mental state. We usually think of “mental health” as a lack of mental illness, but we should think of a positive quantity, too – call it “mental fitness”. Mental fitness is the answer to the question, “How prepared am I for difficult mental activities?”

How do you achieve mental fitness? Honey Dill’s take might not be scientific, but it rings true for me:

Now, I get some of this from my job:

  • Routine (most jobs give you this)
  • A creative outlet (from building web apps and writing blog posts)
  • Social activity (from talking to colleagues, and some remarkably interesting customers)

But I need to find the rest of it from something else – and that’s why I spend a lot of my time growing vegetables.

Pictured below is my allotment: 100 square metres of mud that I rent from the town council for £22 a year. One condition: anything I grow there, I must be able to eat.

Spending time working my allotment actually fills in most of the chart! I get:

  • Exercise from digging the mud and carrying water around.

  • Sun and air. Yes, this is the UK, so it’s mostly “clouds and water” – but even a cloudy day is a lot brighter than you think! There is usually around 10 times more light outdoors than indoors. It doesn’t feel that way because of Weber’s Law: humans perceive brightness logarithmically, not linearly. But that’s still 10 times more vitamin D, among other things.

  • Meditation: it’s not just sitting around doing nothing (although it can be). If you’re doing a really absorbing task with a visceral sensory experience, that’s a form of meditation.

  • Sleep comes easily after all that exercise and meditation.

  • A healthy diet comes from what I grow - I have to do something with it!

  • Social activity is provided by my fellow growers.

  • Routine comes from the yearly cycle of sowing in spring and harvesting in autumn, and the weekly/daily routine of watering and weeding.

  • and a creative outlet comes from planning the plot and working out how to use the produce.

All I need now is love, humour and therapy - and luckily, I married an amusing psychologist.

I’d recommend an allotment to any developer. But if you don’t want to dig around in the mud, find some other way to get these factors. Take up a sport. Meet up with a friend in the park. Take up meditation. Cook from fresh.

And if you employ developers, it’s in your interest to provide these things for them. Give them a light and airy office. Set up tables outside where everyone can eat together. Start a cycle-to-work scheme. Provide free fruit and veg.

Of course, in our office, getting enough fruit and veg is…not the problem:

Speaking of creativity…

Do you want to build a web app, but don’t want to mess around with the Javascript framework of the week? Anvil lets you build full-stack web applications with nothing but Python. Design your UI with drag-and-drop, write Python that runs in the browser, Python on the server, and deploy it with one click.

It’s free – give it a try: