DEV Community

Cover image for How to avoid headaches while coding?
Shubhra Agarwal
Shubhra Agarwal

Posted on

How to avoid headaches while coding?

Sitting in front of the laptop for prolonged hours coding or doing office work has been very common since the start of the pandemic.

"How to avoid headaches while coding? 😶"

This is the question that I have been asking myself for a long time.
These are the few tricks I used to reduce my headache :

1️⃣ 20-20-20 rule

There's a reason why this tip is on the top of the list.
This is the most effective way of reducing your headache frequency and intensity.

You just have to look at something 20 feet away for 20 seconds every 20 minutes. This not only reduces your headaches but also helps in keeping your eyes healthy as sitting in front of a screen for long hours eventually makes us near sighted because we do not look at fat sighted objects. So, focusing on something which is at least 20 feet away from you will prevent this from happening.

It's a "strict" rule, but really just looking away often enough is THE tip for me to avoid a headache.

2️⃣ Good lighting

Lighting is a key point in preventing headaches. A lot of programmers like to code in the dark, even though it looks cool, it's harming you in the long run. All the light from your screen will put strain on your eyes if the surroundings are not brighter than the screen. See what works for you, it might be using a light behind your screen or dark mode on your screen. You can even get a monitor light.
If you need it, zoom in on web pages!

3️⃣ Always have water next to you and drink as often as you can

Dehydration has a direct impact on the brain as brain cells require water to function, just like other cells in the body. Water is also needed to prevent tissues from drying out.

Being hydrated plays a huge factor in reducing the frequency and intensity of your headaches.

4️⃣ Blue light filter glasses

This might sound a bit cliché but blue light filter glasses helped me a lot! They not only reduce headaches but are effective in fatigue, insomnia, lack of focus and blurred vision. If you haven't used them yet then I strongly suggest you to try out a pair of blue light filter glasses.

Everyone is different, these are my tips! I hope they work for you too!!

Top comments (0)