HACKER Q&A
📣 vucetica

Can't focus when writing code in dark mode


Seeing fellow programmers left and right switching to dark mode and everyone seems very happy. I gave it a try a few times but it just doesn't work. I can't focus.

It is not the time that I need to get used to a different syntax highlighting scheme because I switch between editors all the time. I'm perfectly fine as long as the background is lighter than the foreground, so it has to do something with the dark mode itself.

Is it that I have to give it more time (so I can stop noticing that "something is wrong"), or simply it doesn't work for some people? And if so, what am I losing (reduced eye fatigue, better sleep...)?


  👤 derekp7 Accepted Answer ✓
The more light that hits your eyes, the more your iris contracts. The smaller hole makes for a clearer image (think of a pinhole camera). People who like dark mode have good vision at screen distance. For some others, they need to strain their eyes more to focus at that distance.

For me, the best is to have dark text on a light enough background, enough screen brightness overall, and a well lit room (natural light is really good, as long as it isn't coming from behind me).


👤 johnchristopher
Most dark modes hurt my eyes, it seems like white characters or graphics on a black background burn my retina (like a glare). For video editing, photoshoping or any apps I use normal `white` mode. For coding I use solarized liked theme with pastels and soft colours.

It could be debated but I think it's a matter of personal taste, habits, personal sensitivity to light and scientific-based explanations and that each of those aspects carry a different weight depending on the person.


👤 eckza
I’m a huge Light Mode guy. I use the morning color scheme in vim, and the light schemes in VS and VSCode.

I do run f.lux, static at 49k... but I have found that dark editor schemes make me feel claustrophobic (!).

Everyone’s different! It just might not work for people like you or I, and that’s okay. :)


👤 olav
I started as a developer in the 80s on vt100 terminals with green and amber on black screens. I vividly remember how nice it was to switch to a light background without flicker and have never looked back. Choose what works for you.

👤 closeparen
I have my IDE and terminal themes following OSX Dark Mode, which I switch in and out of throughout the day depending on ambient lighting. My screen is perpendicular to the window, but still there's a period in the afternoon where it's almost impossible to read dark mode text.

At first I couldn't find a way to automate this and was doing it manually, but there are plugins for both iTerm [0] and IDEA [1].

Think of it as an adaptation for working in a dark environment, not something you use all the time.

[0] https://iterm2.com/python-api/examples/theme.html

[1] https://plugins.jetbrains.com/plugin/12515-dark-mode-sync


👤 bretthowell
It seems most of us develop astigmatisms from using our screens less than an hour, particularly when at a 40 dev angle (like a laptop, phone) [1] and despite being temporary (mins, hours, days) the astigmatisms themselves vary in angles and wavelengths (read dark text, light text) effected from person to person. All of this adds up to no one person having the same level of strain from the same colors/brightness, and then compounded by it constantly changing and shifting with eye strain. For example, one of my eyes has trouble focusing on dark blue on bright white as the day progresses, the other eye hates red on black.

[1] https://eyewiki.aao.org/Physiology_of_Astigmatism


👤 lordnacho
Dark vs Light mode seems to be the next Vim vs Emacs religious war. I'm on the Dark side.

I've not only got all my IDEs in dark mode, all my browser apps use stylus to darken things if the app doesn't already have it, and my MacOS is set to be permanently dark. And naturally my terminal window as well, and my mobile apps on all devices.

I simply find the strain on my eyes is a lot less. Particularly at night if I feel I need to reply to a message or use the laptop for whatever reason, it doesn't make my eyes hurt to open it. Before my dark mode revelation it would actually make me have to close my eyes.

Aethetically it makes sense too. With dark your laptop stops being a massive source of light, it's more of an everyday object that fits in any lighting.


👤 dannypovolotski
Until this month, I was thinking that I like dark mode better, but then I started experiencing vertigo, nausea and all sorts of migraines after long programming sessions. I tried light mode and it went away. So light mode all the way for me!

👤 rement
It depends on the environment I am in. If I am in a dark room (my coworkers like the dark for some reason) it is much less glaring to look at a dark screen. In a well lit room (like my home office) a light theme is much easier to use. I just switch between the Tomorrow and Tomorrow Night themes.

https://github.com/ChrisKempson/Tomorrow-Theme


👤 toast0
Dark mode appeals to some people and not others. Having things available only in dark mode would be just as bad as only in light mode. (Having things only available in system colors, and having that have many well tested color schemes would be most preferable, but since it's not 1995, I guess that's not going to happen)

If you want the least eye fatigue, you gotta go with yellow on blue, like Word Perfect of old. It's all about compromises.


👤 wdewind
I wonder if this has to do with getting less blue light. After I started using flux I found myself getting exhausted and unable to focus after around 3-4pm especially in the winter. Bumping flux back to only after work made a huge, noticeable difference for me. Might be a similar effect with bright vs. dark screen.

👤 DyslexicAtheist
started using and learning linux from the console so there was always a nostalgic reason for me to have everything in solarized dark. the last 2 or so years my eye sight has dropped due to aging but also because of way too much time on a screen. I notice it especially during reading ebooks at night that a dark theme isn't doing me favors so switched to an e-paper like color and slightly reduced screen brightness for late night pdfs/ebooks reading. (redshift does nothing for me here). an epaper color is a lot easier on my eyes than dark mode. still use dark colors for terminals during my day work but am also considering changing this but maybe it's because my eyes aren't tired throughout the day as much as they're between 21:00 and 02:00 ...

👤 tuesday20
I hate dark mode, I thought I was weird. Glad to know there are others who prefer light mode!

👤 zeta0134
Honestly I also find that I can more easily focus on light mode text when I'm well rested. Dark mode for me mostly reduces fatigue over time, preventing the ghosting after-image that my eyes do if they stare at a white background too long.

If dark mode isn't your cup of tea, you might try just decreasing the contrast of your light background or lowering the brightness on your monitor to get the same benefit. But really, your eyes are yours. If your setup works and doesn't seem to be causing you eye strain? Use that! No problem at all.


👤 fileeditview
I used to use dark mode but for a few years now I strongly prefer light mode. For Vim and Vscode I use the papercolor (papercolor redux for vscode) theme and on Emacs I use the hemisu-light theme. Both of them are great.

I still use most terminals in dark mode because I dislike their light color themes.

I guess the essence is that I prefer light themes if they are really good (for me). In the end this is all subjective and you should just choose by comparing themes yourself and not because others use "some theme".


👤 edh649
Use what works for you. Personally I frequently switch between the two as I find that light mode works better in the day for me, while dark mode is better in the evenings/night.

👤 cortic
White text on black is as bad as black text on white for me; But I find off black (12/16/33) background and off-white (248/248/248) text significantly reduces eye-strain, for me at least.

If any of you are anywhere near 40 and feeling eye strain; you might be starting to suffer from presbyopia as i and most do at that age, getting a larger monitor and placing it slightly further away helps a lot more than any theme changes.


👤 abraxas
Dark mode hurts my eyes. My vision is still good enough for black on white background text but the inverse colors make it physically hurt when I try to read the same text in the same font size due to the slight astigmatism that I have.

Interestingly I developed astigmatism over a few short days when I was under a lot of mental trauma. Not sure if that was causal or just coincident. Can a serious emotional shock damage eyesight?


👤 apotheosis
I was in the same position as you, not too long ago. I kept reverting back to my familiar light themes.

Switching to The Dark Side finally stuck after using it for a few weeks straight. Now I can't imagine going back. When I switch to an app without a dark mode, it's like staring at the sun.

I don't have any issues with dark mode. I feel like my eyes are more relaxed not having to contend with so much incoming light.


👤 tpmx
I've noticed people either prefer dark or light when working. It's very binary.

In my 20s/early 30s I really preferred a dark environment when coding. It's how I "grew up" with my first job back in the 90s, based in a cellar.

At some point around being ~36-38 years old I randomly started feeling that I preferred a light environment - a view outside would be really nice too.

I think it's mostly due to what you're used to.


👤 chadlavi
I personally prefer dark mode, but I don't think there are strong scientific arguments for either side. It's a matter of personal aesthetic choice and comfort. If light mode is the one for you, go for it!

edit: and I don't know about other folks, but a big part of the decision for me is tied up in nostalgia for an age I never lived in, the whole like, "hacker aesthetic" thing.


👤 cpach
I prefer black on white (or off-white) in Emacs and in the macOS terminal. It reminds me of paper and therefore feels “natural”.

👤 olefoo
if it doesn't work for you; it doesn't work for you.

Your personal productivity story doesn't have to be like anyone elses. As you work, start paying attention to what conditions seem to work better for you.

Different brains and bodies are different, and programming as a mentally strenuous activity requires that you pay attention to your mental wellness.


👤 moltar
Yup same here.

I just can’t do dark mode at all. I’ve tried multiple times, using different themes.

It’s jarring and too contrast-y on my eyes, which is distracting and I can’t scan the code fast because of it.

How’s your eye sight? Last time I checked I was 20/20.


👤 pmontra
I write code in black windows (#000) and my terminals are also black. Everything else is white (#fff). No problems with that except the ones caused by aging, but I'm still ok with a screen at a harm's length.

👤 zamalek
I am a dark mode believer, but I absolutely cannot focus when the background is true black.

> Is it that I have to give it more time

It did take me a few weeks to get used to dark mode, but every human is different. It may just not be for you.


👤 gentleman11
One problem with light modes is that they tend to be higher contrast or harsh, or pick their colours in a weird way. Last time I looked at trying light modes anyway, I tried over 20 extensions

👤 BerislavLopac
It's interesting how I find it difficult to code in a dark mode, while at the same time I just can't use a terminal with dark characters on a light background...

👤 yedava
After using light mode for several years, I tried dark mode for a few months. Initially I really liked it, but after a while, it just felt gloomy and I switched back to light mode.

👤 xaedes
I once released a programming "writer's block" by switch back from dark mode to light mode.

I actually like dark mode, but I feel like I am still in a "light mode" phase.


👤 nurettin
Dark modes are great, until someone decides to use dark color fonts on dark backgrounds (which constitutes up to 99.9% but not all of the themes)

👤 meddlepal
I find it hard to focus without dark modes. Eye floaters are way more visible on light screens.

👤 loopz
Try customizing your own colors, fontsize, etc. Sometimes default themes just suck.

👤 iphone_elegance
I prefer it, but can't use on screens when there's heavy glare (macbooks)

👤 exabrial
Definitely not. Reduces my eye strain. Been doing it for about 10 years

👤 mbrock
I use dark mode at night and light mode during the day.

👤 AltruisticGapHN
It’s just a fad. I never really enjoyed dark mode. I always liked to set my editor’s background to a slightly less bright value like #eee.

Dark mode doesn’t soothe the eyes at all. Just look away after using editor in darkmode and you have these bright patches on your retina. With normal dark onlight background, I never notice this.

Just a matter of not setting your monitor brightness to stupidlevels, for example on an iMac 50 to 60% brightness is plenty. On my iPad i hardly ever use 100% brightness.

I do like my terminal in classic dark mode, so maybe i am contradicting,myself? But it’s not the same: i don’t stare at the terminal continuously, idon’t edit in the terminal (eg. vim, i always use gvim).