Simple Guide to Deal with Painful Programming Headache
Tags: productivity, health, coding, bestpractice
Published: 2020-06-22 16:15:46

**Does programming give you a headache?** Do you feel tired after few hours of coding? If so this article is for you. You will find most common reasons for programming migraine and how to relieve the pain.

## Step 1: Identify the reason for the headache

The first step is to find what is the reason for the headache. It's extremely important to identify what is the cause and what is the type of the headache. This will help you to treat it better and address the problem in right direction. Below you can find most popular reasons associated with programming headache:
* Eye strain
* Bad colors / Dark theme(+ astigmatism)
* Bad posture
* Bad music / Noise
* Over-thinking
* Dehydration

Once the type of headache(you are suffering from) and the reason are clear  you will know what practice to use to relieve it. In some cases, a head massage can help in others taking longer breaks. In the next step you can find how to ease the pain caused by headaches.

## Step 2: Tips to relieve coding migraine

What are the best methods to relieve stress? I'll try to list the one which works for me. 

#### Try Massage

You can do it yourself, or simply ask a friend / a specialist.** A few minutes massaging your neck, top of the head and temples can ease a tension headache, which may result from stress**. You can also buy simple massager like:

* <a target="_blank" href="https://www.amazon.com/gp/product/B07BGWXFG3/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07BGWXFG3&linkCode=as2&tag=softhints-20&linkId=f83f688a4149ffdd3120776b129a95d0">Wooden Acupressure Massager with 5-Knobs - Multi-Knobs for Assorted Pressure Points for Deep Tissue Massage</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07BGWXFG3" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
* <a target="_blank" href="https://www.amazon.com/gp/product/B07QKSNPBR/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07QKSNPBR&linkCode=as2&tag=softhints-20&linkId=337d1bab87863c12971b23b27ab8b621">Scalp Massagers with Wooden Handle by  Divine Light - Handheld Head Scratcher - No Snags, Tangles Head Massager - Stress Reliever Massage Tool for Home Spa Relief and Relaxation (5 Pack, Random Color)</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07QKSNPBR" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

I'm using the first one and it really make the huge difference in the end of the long working day. After several minutes of massage I feel warming feeling which:

> I can feel that all the way down in my toes!


#### Deal with Bad music / Noise

I was working simultaneously in open office and from home for several years (on weekly basis). I found out that my performance from the office was bad and I was less productive. It was really hard for me to concentrate and focus on the task which I had for the day. **At the end of the working day I had also - subtle pain in my forehead**. 

I tried to change different things until I found the real cause for my suffers - the noise in the open space. The noise was on from the early morning till the late evening. Only when most workers were gone and the air-conditioner was off I was able to do something properly. What was **the solution which helped me to deal with the constant noise**? It's called - **Noise Canceling Headphones**.

Below you can find two models which will do the job:
* <a target="_blank" href="https://www.amazon.com/gp/product/B07Q9MJKBV/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07Q9MJKBV&linkCode=as2&tag=softhints-20&linkId=a10286b2cc24d59dd9513c7c03e10654">Bose Noise Cancelling Wireless Bluetooth Headphones 700, with Alexa Voice Control, Black</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07Q9MJKBV" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
* <a target="_blank" href="https://www.amazon.com/gp/product/B019U00D7K/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B019U00D7K&linkCode=as2&tag=softhints-20&linkIIf d=394efb7beed3171ef5021baca17471e7">COWIN E7 Active Noise Cancelling Headphones Bluetooth Headphones with Microphone Deep Bass Wireless Headphones Over Ear, Comfortable Protein Earpads, 30 Hours Playtime for Travel/Work, Black</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B019U00D7K" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

Be careful because bad music might be another reason for programming migraine. So I prefer to:
* Work on quite place in nature when it's possible
* If not - use noise canceling headphones with nature sounds
* Listen low acoustic music

#### Dehydration

**Dehydration is one of the greatest migraine triggers**. It might be related to drinking alcohol, too many cups of coffee, too salty food or simply don't drinking water. The focus on hard problems or staying too long in front of computer might deceive your thirsty feeling.

What could be done? You can 
* **add a cup or bottle of water on your desk.** If the cup is present on your desk it's more likely to drink it. 
* Frequent breaks will normalize your senses - so you will find if you are thirsty or not.
* Drinking tea


#### Fix bad posture problem

Incorrect posture causes migraine and back pain. Most probably there is muscle imbalance which can be treated in long term with sport, stretching and exercises.  In short term (or if you don't have 15 minutes per day for stretching) you can try to:
* check if your monitor is ergonomically correct - the top 1/3 of the screen is at eye level.
* sit up straight
* avoid any prolonged stay
* use ergonomic chair like:

* <a target="_blank" href="https://www.amazon.com/gp/product/B07VSVY7ML/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07VSVY7ML&linkCode=as2&tag=softhints-20&linkId=8e4287ae53927220610cf3c09407539e">Fortnite OMEGA-Xi Gaming Chair, RESPAWN by OFM Reclining Ergonomic Chair with Footrest (OMEGA-02)</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07VSVY7ML" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
* <a target="_blank" href="https://www.amazon.com/gp/product/B07VSVY7ML/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07VSVY7ML&linkCode=as2&tag=softhints-20&linkId=13cd431e90d18d8d35c633b73353e4f0">Fortnite OMEGA-Xi Gaming Chair, RESPAWN by OFM Reclining Ergonomic Chair with Footrest (OMEGA-02)</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07VSVY7ML" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
    
Keep in mind that the long term goal is to stay less on the chair and be healthy. Even the most ergonomic chair will not help if you have bad habits.  The key point here is to cure the muscle imbalance.


#### Bad colors / Dark theme(+ astigmatism)

There are studies that show some fonts and colors can result in migraine headache. Monitor screen colors, color theme, dark mode can be considered as  triggers. For example dark mode theme in combination with astigmatism result in eye strain for me.

Best option here is to experiment with different setups and applications. Most probably your monitor have native option for regulating the working regime like - I-Style color:
* Standard
* Game
* Cinema
* Scenery
* Text

I found out the Text regime is best working for me. **In combination with programs like Red-Shift which decrease the levels of the blue light - I solved the headache related to colors and intense light.**

#### Decrease eye strain

Another common problem is eye strain. It can be related to many factors like:
* wrong view angle
* staying for too long of monitor
* bad or no light
* bad / old monitor

You can try to change the position of your desk - closer or further from a window. To decrease direct sunlight or change the direction of your monitor. Play with the level and the inclination of the monitor. 

Change of fonts and resolution is another option. If you read text in your browser you can increase the font size. **A simple trick which helped me a lot in the past is to rinse my eyes with cold water**. I did this regularly for one month and the headache which I had at that time due to bad monitor - disappear completely.

Buying a new monitor still can be an option. You can find some ideas below:
* <a target="_blank" href="https://www.amazon.com/gp/product/B07KGR784M/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B07KGR784M&linkCode=as2&tag=softhints-20&linkId=e4f9dd36e0bc2e603dfcc112599cc1b6">Dell Ultrasharp U2719DX 27-Inch WQHD 2560x1440 Resolution IPS Monitor with Infinity Edge Bezels, Black</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B07KGR784M" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
* <a target="_blank" href="https://www.amazon.com/gp/product/B01K1INYWG/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B01K1INYWG&linkCode=as2&tag=softhints-20&linkId=3bdcf7924c5bcc2d4801d5b14111386d">BenQ PD2700Q 27 inch QHD 1440p IPS Monitor | 100% sRGB | AQCOLOR Technology for Accurate Reproduction</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B01K1INYWG" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
* <a target="_blank" href="https://www.amazon.com/gp/product/B075CZD4YF/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B075CZD4YF&linkCode=as2&tag=softhints-20&linkId=1a95b26dabe9441e97a3dc982310fcf0">Iiyama 24 1920x1080, 4ms, AMVA panel 13cm Adj. Stand, 250cd/m, XB2483HSU-B3 (13cm Adj. Stand, 250cd/m, VGA, DisplayPort, HDMI, USB-HUB, Speakers)</a><img src="//ir-na.amazon-adsystem.com/e/ir?t=softhints-20&l=am2&o=1&a=B075CZD4YF" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

#### Over-thinking

Don't try so hard.  Take  difficult problems easy and step by step. Take your mind off the problem, switch to something else, just relax or simply enjoy the day outside. Do take an afternoon nap to rest your brain, eyes and nerve system. 

Attack the problem from different angle or ask for help. Think deeply for simple things requires a lot of energy and mental strain. Try to balance it with the same amount of relaxation.


## Step 3:  Tips for prevention of coding migraine

In addition to previous steps you can find several simple things which you can do to ease the pain. Try these tips and get to feeling better:

#### Meditation

Meditation play huge role in the connection between our internal and external worlds. It helps to controls anxiety, promotes emotional health, fight stress and enhance focus. Start short meditation sessions on daily basis and you will find a clear picture of your mind. By improving attention and concentration you will solve problems faster with less mental power.

#### Frequent walks

The benefits of nature walks are difficult to be listed in a short article like this. But definitively one of them is - headache and stress prevention. The more time you spent out in the nature the more you will benefit from reduction in stress levels and burn out probability. 

For sure nature walks improve concentration which will help you solve hard problems much faster and with less efforts. Fresh air is the natural food for your brain. Quick walk during the work day may do the difference between successful worker and struggler.

Pro Tip: You can remove your glasses when you walk in the nature or outside.  This helps me to relax my eyes and mind (I have average near-sightedness). But please be careful!

#### Afternoon naps and more sleep

Do you know what is common between: 
* Aristotle
* Leonardo Da Vinci
* Albert Einstein
* Thomas Edison

At least one thing which I know was their love for naps. Working as a programmer is mental draining occupation which requires long periods of concentration. One of the ways to rest from this long periods is by sleeping and switching off your brain for some time.

Sleep is extremely important for memory, concentration and relax of the mind. 8 hours of strong sleep is a good recipe for headache killer.


## Conclusion

People who suffer from programming headache are susceptible to a number of factors that can trigger and boost such condition. Programing is related to staring at code all day with intense concentration which is challenging from a vision and mental perspective. 

In combination with bad sleep habits, not drinking enough water, eating unhealthy food, constantly rushing deadlines might result in headache and stress.


What we could do to prevent headache is:
* take regular short breaks to give your eyes and brain a rest
* going for walk. Walking outside will clear your head, improves your productivity and give you fresh energy
* live more active live - include sport and stretching in your daily routine
* focus on small things like: drinking a cup of water, stare at distant object, afternoon nap or chat with colleague.