Migraine Programmers

If there are any programmers out there that, like me, suffer from migraines (of any level), you know what a shit this can be when it comes to what you do best and the fact that it involves staring at lines of text on a bright screen all day long. I myself suffer from hereditary migraines that can be anything from a mild headache to a full blown, week-long (sometimes two) assault on everything in my life.

I’m a geek, so I get real enjoyment out of the problem-solving nature of programming, and it can be really hard to lay in bed in the dark while you have so many ideas and thoughts rushing around your head, and all you want to do is code them out. This is how I’ve come up with these tips.

Because migraines are so unique to the person suffering them, the tips I give here may or may not work for you. I also program pretty much exclusively on Mac and Linux now so some of the apps won’t be directly available to Windows users – sorry!

I’ll start from the top and work my way down (oy vey!).

The Display

The display you use as a migraine sufferer is truly key because for most people, staring at something bright and straining your eyes are two of the biggest triggers for migraines, as well as just plain old headaches. I’ve invested in an LED-lit display that only gives out true organic light. This has made a huge difference to how long I can work at a computer. The light doesn’t aggravate my eyes and I never trigger a migraine because of that fact alone. It also has a built-in light sensor that adjusts the brightness for me based on the environment, just like my MacBook Pro does.

If you can afford one, or if you have an iMac/MacBook Pro/Apple Display:

  1. Keep the contrast at around 50-70%.
  2. If your display has a light sensor, let it decide the brightness.
  3. If it doesn’t, or even if it does, get an app from the Mac app store or something similar that allows you to change the brightness/contrast beyond it’s limits. I use “Brighter Screen Lite” because it’s free and it does one thing and does it well.

The Text Editor / Terminal

The best text editor for me, whether I’m in an attack or not, has to be Sumblime Text Editor 2 with the Soda Dark UI theme (get that using Package Manager). The extremely low contrast is great both in the day and at night and stops my eyes straining, as well as helping it look sexy.

On the subject of day and night, the type of colour theming I use also has a major effect, to the point where I’ve spent hours creating a perfect set of themes for the apps I use. The most common are Sublime and Oh-My-Zsh!, and I’ve included my themes for these here. As you’ll see, I’ve use very faint low-contrast colours even for the day themes. This is because of the huge contrast between having a white/light-grey background and dark text can cause a Migrainepocalypse.

It’s quite important that you use the day theme in the day and the night theme at night because of the way the eye works. If you use a dark theme in a bright environment, you risk straining your eyes and causing a migraine. I do sometimes switch depending on how I feel, but it’s up to you.

I’ve tried to make the Sublime theme not only look nice and be functional, but help your poor brain out too:

  1. Comments are very faint so that they don’t visually clutter the code. I comment on everything that isn’t obvious – I don’t consider it a problem.
  2. Keywords and constants are bold and italic to highlight structure.
  3. Strings have a background to make their content more obvious in formatting code.
  4. Methods have a bright red background, again to highlight structure.

The zsh theme follows the code theme on purpose, but has a few little goodies packed in. By default, the path shows with a green background. If you cd into a git repo, the background will reflect the state of the repo. If there modifications, the background will turn red. This is mostly just a reminder to me to ‘commit often’ as I tend to forget…

You can download the themes at the GitHub page.

A note on colours

Believe it or not, colour plays a huge role in migraine triggering. Personally, bright yellow and green cause me to start swaying like a tree in the wind. Red however, seems to calm my brain down – hence the strong use of it in my themes (that and it’s the Ruby colour!). You will have to choose the colours that best suit you.

Your Environment

Standard working and living tips apply here as for most people, but as a migraine suffering programmer, you need to take a few extra steps:

  1. Cut down or stop drinking coffee while you work. Caffeine is a major cause of migraines so swap to something that’ll keep your brain awake and healthy like (flavoured) water with no fake colourings.
  2. If you listen to music, get a good pair of in-ear or over-ear headphones, not a cheap pair that make everything tinny. On-ear headphones cause the muscles around your ears and by extension your eyes/neck to tense up. Migrainepocalypse.
  3. Take more breaks than most people. I get up and have a walk around, get some air/get a drink/confuse my dog/lay down every 30 minutes or so for 5 minutes if I can. Obviously in a work environment this can’t be as regular, just as long as you give your eyes/brain/body a rest.
  4. Get more exercise. It opens up your blood vessels, gets rid of any junk in your system and is generally quite good for you I’ve heard. I cycle because I have a mutinous ankle but anything helps, and in the long run can actually prevent migraines.


A lot of people (especially parents) say that staring at a computer screen in a dark room is bad for your eyes. I actually find it to be the opposite when I’m IN an attack. When I’m not, I use an LED lamp (again for the organic light) by Phillips which is great low lighting that doesn’t stress my eyes.

That’s all for now – stay tuned on the GitHub page for updates and if you have any migraine friendly tips or themes, please feel free to send a pull request! 🙂

2 thoughts on “Migraine Programmers

  1. I think the most important thing is getting outside and doing sports. Every day. (oxygenates the brain, changes your posture, strengthens the muscles, reduces tension…)

    • Definitely. A good, long-distance cycle (30 miles or so) on my road bike stops me getting them for quite a while, sometimes months. Unfortunately the roads where I am at the moment are so dangerous, it kind’ve puts me off. I’ve had to buy a turbo trainer and sit in the garden whizzing away haha. Stress and tension are a huge trigger for me, but my body changes a lot year on year. I used to not be able to eat dairy products but now they do nothing. The worst trigger for me at the moment, sadly, is red wine 😦

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s