16 ms·
Ask HN: How do you protect your eyes while coding for long hours?
We often spend long hours staring at a computer screen, which can take a toll on our eyes. What are some effective ways that you have found to protect your eyes during these long coding sessions? Do you have any specific techniques or strategies that you use to prevent eye strain?
- clay-dreidels 4y ago
- CharlesW 4y ago> Blue light is a type of light that is emitted by the sun and by electronic devices, and it has been shown to cause strain on the eyes and disrupt sleep patterns. I thought the issue for macular health wasn't "blue light" in particular, but high-intensity light energy in general: https://pubmed.ncbi.nlm.nih.gov/29044670/ https://pubmed.ncbi.nlm.nih.gov/29044670/
- yadaeno 4y agoYou write very similar to chatGPT.
- deleted 4y ago[deleted]
- 32gbsd 4y agoDark, low contrast monitors mostly but you will eventually either become near sited or far sited as your eyes get older.
- silisili 4y agoI turned my brightness way down, mainly because the floaters I got in my mid 30s started really annoying me. I use dark mode where I can. Lastly, I just don't code for long stretches anymore. I usually get up to walk around every 60 or 90 minutes, for my knees and my eyes.
- lajosbacs 4y agoMy case exactly! Also mid 30's and I also have floaters unfortunately and according to my trustful ophtalmologist, there is little to be done about it. It is not that I have a problem per se, but this condition made me realize that my eyesight won't get any better and since I depend on it for a living, well.
- silisili 4y agoSame! It's one of those things nobody tells you about apparently. I remember being on a plane and looking out the window and seeing them everywhere all of a sudden, and naturally thinking something was majorly wrong. Rushed to the eye doc when I got home, he just did a few checks, shrugged, and said it's normal.
- lajosbacs 4y agoI had this realization while in snowy mountains. All is white and suddenly I thought that I had a lock of hair in my line of sight.
- satvikchoudhary 4y agoTurning brightness down is not recommended. You will experience more vision problems if you do it for long. Decreasing brightness decreases your field of vision, makes it harder for your eyes to focus and will worsen your nearsightedness or increase risk of getting it. For more context, my eyes became much healthier after I increased the brightness of my monitor to 60% (250nits) since last 4 months. Before then I used to regularly use it at 10% (40nits). My power numbers were getting worse and I even had high IOP, which has improved now.
- lupire 4y agoI've suspected this. Do you have any references?
- 4y ago
- jerrygenser 4y agoAs others have said, you can add blue light filter either based on app or monitor configs. If you were eyeglasses, it's worthwhile to pay an extra bit - usually on the order of $50-$100 - to get a blue light filter built directly into your glasses. Further, my optometrist specifically recommended that I use slightly underpowered prescription. I'm at about 90% of what my glasses prescription could be but he tells me that this means my eyes will strain less. It has seemed to work for me since after a few years of having to increase prescription every 1.5 years or so, it's starting to slow down. Could be anecdotal or caused by aging but something to bring up with your own optometrist if you have one.
- Eleison23 4y agoI'm waiting for new lenses/frames as we speak, and I made a mistake two years ago in accepting the "blue light filter" coating that they were pushing. It was horrible - everything was green, especially my peripheral vision. It ruined my experience off the computer. So I took the glasses back to the optician under warranty and requested they be remade without the filter coating. My experience immediately improved and I was satisfied with those lenses. Never again will I opt for that ridiculous blue light coating. The blue light bugaboo is a hobby horse of my psychiatrist and other quacks. It really makes little difference, because the intensity of the light coming from your monitor or your smartphone is negligible compared to sunlight/daylight. What matters ten times more than blue light is what you are doing on that computer at night: are you engaging in bitter social media arguments? Playing twitch AAA games? Are you watching YouTube with a ton of fast talkers and ads and quick edits? That will amp up your hormonal imbalances and disrupt your sleep patterns surer than the color of light wavelengths coming into your retinas.
- gruez 4y ago>If you were eyeglasses, it's worthwhile to pay an extra bit - usually on the order of $50-$100 - to get a blue light filter built directly into your glasses. Is there any evidence that they work? Most implementations I've seen are essentially colorless, so I find it hard to imagine that they're blocking that much blue light.
- ushercakes 4y agoI use https://justgetflux.com/ https://justgetflux.com/ and have it set to night mode at all hours. I also wear glasses with blue light filtering. No issues with my eyes anymore personally
- lern_too_spel 4y agoLikely a placebo effect. https://www.aao.org/eye-health/tips-prevention/are-computer-glasses-worth-it https://www.aao.org/eye-health/tips-prevention/are-computer-... I just remember to blink, and I also have no trouble with eye strain.
- tartoran 4y agoIn addition to the filters and blue light reduction, I noticed that staring at magic eye “stereograms” relaxes my eye muscles, removes headaches in minutes. It works for me, may work for others. Once I lock my eyes on the behind the page plane I move my eyes everyehere on the image without loosing focus, corners too. Helps me tremendously. Got nothing to lose to try it, basically enjoy some magic eye stereograms from time to time. Play with sizes too. Both screen or printout versions work out for me. Another obvious one is stare out the window but it’s not as immediate as stereograms to me.
- ThrowawayTestr 4y agoI'm surprised no one's mentioned it. I hear the 20-20-20 rule is effective. Every 20 minutes spent using a screen, look away at something 20 feet away for 20 seconds.
- grepLeigh 4y agoEven if you don't wear glasses for distance or reading, consider getting computer glasses. Computer glasses have the blue-light filter mentioned in other posts, with slight magnification that helps your eyes relax while focused on a computer monitor. Take frequent breaks and focus on objects at different focal depths (stare out a window and count leaves, look for patterns in clouds, mentally trace a pattern across an opposing office building)
- aizyuval 4y agoI asked an ophthalmologist (My father) about the issue: He thinks that healthy habits keeps you safe. As a general rule, try to avoid making too much effort. • Avoid sitting in a dark room with just the monitor on. • avoid being too close to the monitor. Distance of one hand length is enough, but not less. (Half of this for your phone). • Have breaks. After one hour, give your eyes some minutes to refresh. I personally use dark mode.
- user- 4y agoOne Arm length? One hand length is like 6 inches lol
- lost_tourist 4y agoI think that has to be it. A hand is 4 inches, no?
- aizyuval 4y agoYes! *One arm length.
- Jensson 4y ago> I personally use dark mode. Why? I never use dark mode and never have eye problems. Sometimes sits for like 20 hours coding. All I do is keep the room well lit. I'm in my 30s. I remember having eye straing a few times like a decade ago, but I guess that was from over eating sugar or something. If you have eye strain I'd guess it has some other reason than the screen or how you treat your eyes. Or maybe you need better glasses. Edit: Dark mode would cause your pupils to dilate, maybe that is the reason for the eye strain people here see? Bright room with bright room keeps pupils small and maybe reduces strain.
- blueflow 4y agoRegardless of bright or dark mode, the screen intensity needs to be appropriate for your environment.
- jjtheblunt 4y agoi use varying font sizes
- ericpauley 4y agoI use a glasses prescription 1 diopter weaker than my regular lenses, and sit about a meter from the display. In this setup, the effective focal distance to the monitor is at infinity (actually a little beyond as my regular prescription is underpowered as well).
- tonis2 4y agoGood lightning is a must for me, my eyes are red pretty quick if i work with bad lights.
- davzie 4y agoCode for less hours.
- HTTP418 4y agoWhen working from home sometimes I'll keep cold cucumbers by my desk and put them on my eyes whenever I'm feeling any strain. Usually when my eyes are straining they are also warmer than normal. I guess you can use anything that doesn't cause your face to be covered in water when it warms up.
- dolores_tyrion 4y agoi do this as well, i use slices of carrot
- nullify88 4y agoI use https://github.com/AutoDarkMode/Windows-Auto-Night-Mode https://github.com/AutoDarkMode/Windows-Auto-Night-Mode to automatically switch Windows and a handful of apps to dark mode / light mode depending on sunset. I think its counter productive to have dark mode enabled all the time and I can feel my eyes strain when using it during the day. Windows, VS Code, Office 365, Edge and a handful of websites that follow the OS settings switch themes. I wish more laptops or screens had ambient light sensors and I would use that instead to trigger the theme switch. Maybe theres a way to use the webcam? I also have a blue light filter on my glasses, and have enabled the OS blue light filter for a stronger effect when its night.
- jeffbee 4y agoEvery 5 minutes, for several seconds, look at something else that is much further away. Every hour, get up and take a 5 minute walk. Don't bring your phone. Generally do much more thinking ahead of time so when you sit down to code it's all over except the typing.
- worik 4y ago> Every hour, get up and take a 5 minute walk. Don't bring your phone. Good for my brain too. It is a must to get up and walk around. Looking at things, yes, but also thinking different thoughts. Back when I worked in an office and when tobacco smoking was still a big, not shameful, thing, I would "adopt a smoker". I would pick a cigarette smoker and say "when you go smoke let me know" and I would go outside with them. These days it is an ingrained habit and I get up and bounce around for five minutes or so every hour or so.
- lost_tourist 4y agoEvery 5 minutes is a bit much, 20 or 30 minutes woudl be a lot more reasonable 20-20-20 rule and all that.
- jeffbee 4y agoThat's why the break timers have preference panes, I suspect. I find that having something go ding! every 5 minutes when I am on-task keeps me from getting distracted and reminds me to cut off any weird side quests earlier.
- smrtinsert 4y agoI use a decent size monitor but lower dpi than my Mac screen as my latest. In my experience my eyes will exhaust much sooner against the Mac screen than my Samsung to the point of blurring.
- dottjt 4y agoOkay, so this is what I find interesting about this post. I actually posted this exact same thing a few days ago, and admittedly at the time, I was fairly confident that it wouldn't kick off because the title was kind of half-arsed and confusing. But also, it was uniquely me. I didn't really care. And when I read this title, it sounds like something ChatGPT would have produced, in a very general way. Even the body sounds very ChatGPT. So I wonder if this user decided to repost my post, in a way that would actually get engagement. Then it got me thinking: Maybe we're reaching a point where the only thing that really matters, is your ability to create prompts. Your ability to ask the right questions to AI, so you can produce the right answers. That will be the future of humanity, and your inability to adapt to this way of thinking will hinder you. Just an observation. Nothing more. But yeah, that title is way, way better.
- deathtrader666 4y agoIf all one learns to do is only "asking the right questions", then how would you know if what the AI has produced are "the right answers" ?
- dottjt 4y agoWell I mean, if at the end of the day the primary game is engagement, I don't think the right answer really will matter any more, at least in the broader context of a discussion forum.
- simmerup 4y agoYou kicked yours off assuming you knew the answer. OP kicked theirs off with the root problem
- dottjt 4y agoYeah, fair enough. I think I'm more used to posting on Reddit, where I think there's an expectation that you're offering something, in exchange for the information that others will provide. So I feel kind of dirty just asking people directly for information, but I guess I'm just wired to a different engagement model. It's also probably why I find News Hacker more intimidating.
- morbidious 4y agoAnti-glare glasses
- CyanLite2 4y agoThey work great, but are terrible for video calls as they reflect the light back so your eyeglasses look like "mirrors" to others on the video call.
- iknowstuff 4y ago* multifocal contact lenses https://www.reviewofoptometry.com/article/add-multifocals-to-your-myopia-toolbox https://www.reviewofoptometry.com/article/add-multifocals-to... * I sit by a window, so I end up naturally staring off * night shift and dark mode https://iovs.arvojournals.org/article.aspx?articleid=2689610 https://iovs.arvojournals.org/article.aspx?articleid=2689610 * always with ambient light around me, never in the dark
- stevebmark 4y agoDon't worry about "eye strain." Muscular use of eyes has no long term effects. Eye dryness does probably does but I don't know much about mitigating it. Blue light affects your circadian rhythm, use blue blocker glasses, use F.lux. Adjust phone and device brightness to be the minimal amount you're comfortable reading. Don't use full screen brightness at night, especially because your pupils are more dilated in lower light environments. Use dark mode everywhere you can. Blue LED light may be toxic to your retina with long term exposure. The jury is still out on this one, but the above steps will help mitigate the issue. The other issue is emmetropization and nearsightedness. Incredibly important to understand for children. It will affect you too if your eye prescription continues to change. It usually stops in your 20s (your vision stops getting worse), but for some it continues to degrade past that. Holding things close to your face keeps your peripheral vision in focus, making your eye think it's over-focusing, so the eye grows longer (more near sighted) to try to correct. This happens without the brain's involvement, it's all based on focus on the retina. Your eye doctor should know about this process, should know about low dose atropine, and should know about glasses with fogged edges, especially for children. Most don't.
- TedDoesntTalk 4y agoAsked the same question to an eye doctor. He said to look away for the screen periodically, at a different distance so your eyes must change focus. It is this focus change that keeps them exercised. He said his patients with the healthiest, aged eyes are those who knit. They are constantly looking closely then away, closely then away, ad naseum.
- stevebmark 4y agoI too have seen eye doctors that extrapolate incorrect conclusions from anecdotes. I'd consider looking for a different eye doctor. Reducing focus in peripheral vision may help slow the progression of myopia (nothing can reverse it), so the advice might be ironically helpful even though it's based on complete misunderstanding of how the eye works. Again, it has nothing to do with muscle use nor the action of your lens changing focus.
- odiroot 4y ago1. Keeping all my displays at low brightness and adjusting the room lighting to more or less match it. 2. Dark mode everywhere I can. Unless an app has completely terrible (e.g. low contrast) dark theme. 3. Desk never facing a wall, rather open room. Let's me rest my eyes at something farther away than my monitor. I don't bother with f.lux or similar. Find it a bit pointless and annoying. Much better to lower the brightness.
- jedberg 4y agoI use flu.x to set my color temperature to 5900K instead of the default 6900K. Makes a huge difference. I use dark mode. I also make sure to look up and outside the window at least every 15 minutes.
- jpk 4y agoYep, taking short visual breaks fairly often is what did it for me. One thing I did was install bird feeders just outside a window of my office (WFH), which gives me a reason to glance away from the screen at a longer focal distance. Also, birds are neat, so that's fun.
- CyanLite2 4y agoBlue Blocker lenses. Also, I get "Plus One". Talk to your eye doctor. They can do "ADD +1.00" to your prescription to make things larger but still in focus. You won't have to hunch forward either. Then I make all of my IDE font settings larger. I see less on the screen, but I have less eye strain.
- gremlinsinc 4y agoNight Eye chrome plugin + clipon rose tinted blue-light blocking glasses, I have a light phobia, I mean I'm not afraid of the light, but bright light paralyzes me and makes me want to cover my head w/ a blanket lol. Natural light I can deal w/a little better, bright overhead lightbulbs are the worst, soft dimmable programmable lights are the best. I have glasses for a stigmatism but rarely wear them (my vision is like 19.5/20 or something like that, but that was 4 years ago), except lately I have because of the new clipons I got from Amazon they were like $20 for 2 one's darker than the other. Supposedly it helps get better sleep if worn before bed, but that's not my primary purpose. It's namely so I can just have less light like when I can't avoid a white page in chrome or something.
- otikik 4y agoCode in your own head while taking a walk away from the screen, several days per week if possible.
- lulzury 4y agoIt's certainly much easier for me to write up the solution to a problem after I've spent some time thinking about it, the requirements, and edge cases in my head if I'm familiar enough with the language, frameworks, and codebase. Sometimes the code can just kind of fall into place.
- jerrygenser 4y agoThere's a 20-20-20 rule where every 20 minutes look at something 20 feet away for 20 seconds. This helps to rest your eyes and reset from the strain of looking a fixed amount in front of your face for so many hours.
- rg111 4y agoI have been a nerd all my life with long reading and computer hours. My eyesight has barely gotten worse. Here are the things that I do: - Blue light filter on all screens, whenever indoors. That's 100% of times on most days. - Lowest possible viable brightness on all devices. - Ambient lighting. An expensive RGB strip on the back of the monitor works. So does $4 table lamp from Amazon behind the monitor. - ARC glasses/blue light cutting glasses on 24 hours. - I take breaks often following a pomodoro cycle. And I go outside in those. I categorically avoid any kind of scrolling or checking on devices (after I read and followed Deep Work by Newport). - I eat a lot of vegetables. I got glasses in 2nd standard. And people who got glasses latter than me and many less nerdy than me have thicker glasses now. I sit in front of a screen for 12-14 hours a day for years. I don't suffer from anything eye-related.
- jbritton 4y agoThis article suggests that dark mode maybe protective against myopia while bright mode may induce myopia. https://www.nature.com/articles/s41598-018-28904-x https://www.nature.com/articles/s41598-018-28904-x
- kkfx 4y ago- blue-light filter glasses (originally from a serious local shop, after have tried the cheapest I found on-line I discovered they are the same) - monitor backlit to the minimum - dark themes - LARGE good-enough monitor with a certain distance (~1m) I still feel some effects, but do not know anything realistic to do better...
- lost_tourist 4y agoI generally use a timer to get up and move around every 60 minutes to stretch my legs and defocus my eyes.
- kazinator 4y ago1. Use a small font. Use a font so small that you can only read it when your eyes are rested and in relaxed focus. When your eyes are tired and dry, you will have to take a break due to not seeing the code even if you strain and squint. 2. Use bitmapped fonts; avoid the fuzzy-wuzzy antialiased nonsense. (I am currently using a font called knxt by Constantine Bytensky which is almost perfect, save for the comma being too small and confusable for period). Alternatively, if you use antialiased fonts, use an 8K display. On 2K or less, bitmapped.) My (1) recommendation comes from experimenting I did as a lad at university. I used different font sizes from very small to huge. I found that the large fonts led to fatigue. I tried to analyze why and realized that it was because the large fonts continued to be readable in spite of fatigue. I could go without blinking for minutes at a time, yet be able to read the text, and so didn't pull myself away from the terminal. When you are in "the zone", you tend to push your body's signals aside. You might delay going to the washroom in spite of a full bladder, and ignore dry, straining eyes and discomforts caused by bad posture.
- bradlys 4y agoOnly thing you really need to do is go outside because of the sustained bright light exposure. Everything else is kinda moot. It’s why it’s important for kids to spend a significant amount of time outside. Your eyes degrade due to low light exposure. Even well lit indoor spaces are incredibly dark compared to the outdoors. Your eyes were made for the outdoors.
- nisaacs2 4y agoTake a break. Go outside.
- jasfi 4y ago20mg Lutein per day.
- pull_my_finger 4y agoTry the 20 20 20 rule. Every 20 minutes, fix your eyes on something at least 20 feet away for at least 20 seconds. This is fairly easy to implement if you do pomodoros as you'll be stopping around then anyway. I get up, refill my coffee, stretch my legs, then go and stand at the door for a while and look at the trees or whatever for a little bit before going back and getting back to work.
- spicysugar 4y agoHey i was in the same place roughly a year ago and i did come up with some measures which i find satisfactory when I reflect upon them. Looks like people already familiar with the argument have given excellent scientific advice for your lifestyle in general. But i would like to specifically focus on the things that practically worked for me when it comes to coding. 1. Try going warm when going dark. I suggest Gruvbox themes for it. I personally use a variation of it called Gruvbox material on vscodium. 2. Prefer using the simplified reading mode in browsers whenever feasible. 3. Use a feature like night light and try to balance the brightness alongside to get a perfect condition(subjective) where the text is legible and has enough contrast. My opinion is that having more night light is much better than a lower brightness. Effects of night light go aesthetically unnoticed in dark modes. 4. Use thin fonts. I use fira code light. They are easier to read from what I had studied then. 5. Matt screens are a pleasure for eyes to work with
- pengo 4y agoI work at home in a low light room. I have my 4K laptop screen at 25% brightness, and the 38" 4K monitor above it at 5% brightness. I eschew dark mode in my IDE and other apps in favour of a light theme. Since making these changes I no longer suffer eye fatigue. Interestingly when I create music (same monitor but a Mac Mini) I turn the 38" monitor up to 35% because the Mac fonts are harder to read at that resolution that my Linux laptop's.
- yashbhatnagar 4y agoProgram in breaks and wear blue-light glasses.
- epirogov 4y agoI have found great option for me is grayscale mode in Windows and Linux. For Windows you need to enable Color Filters in settings, then you can use Win+Ctl+C to toggle this feature. This help for me when I tired within a days to see colorful but not interesting content. From this I way out to gray monochrome monitors world, thank you for feature I don't need to by real monochrome monitor for me. But often I make monitor zero bright, zero contrast for most text typing tasks. This really help every day. An last but not least, I use only warm color temperatures.