Why do developers prefer dark theme in code editors?

If you look at this poll, you will see that out of 214 participants, 92% developers said they prefer dark theme.

So, my question is why do developers tend to prefer dark as compared to white?

Start a personal dev blog on your domain for free and grow your readership.

3.4K+ developers have started their personal blogs on Hashnode in the last one month.

Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more

Robert Gerald Porter's photo

Definitely to save ones eyes from becoming sore. It might not be so bad when you're a part-timer or hobbyist, but after a few years of coding daily the brightness can take a toll on your eyes. Years ago I used to have to sit in the dark listening to podcasts/lectures/audiobooks to recover each day -- couldn't watch TV or go outside without dark sunglasses, my eyes had just become too sensitive to light. A dark IDE helps, as does taking regular breaks and making sure to turn down the brightness on your screen to the minimum necessary.

Show +2 replies
Sandeep Panda's photo

@rgeraldporter : Reply to reply is not supported. You can just mention Hugo ( @hugollm ) and he'll be notified!

Shreeraj Jadhav's photo

I hot key invert colors, so I can read websites with dark background too.

Remco's photo

So when does hashnode get a black theme?

Show +1 replies
Jamie Glasson's photo

in chrome://flags there is a force dark mode for web contents which applies extra styles to the css to make the site dark I use it the only annoying thing is sometimes when people use background images it changes the text from black to white make it unreadable.

Jamie Glasson's photo

Jamie Glasson this only works in chrome and the new edge in edge you have to use edge://flags

Sébastien Portebois's photo

Let me share my personal story: I used to work with light themes, then switched to dark themes, a switched back a few months ago to light themes.

Why?

Because I changed my desk location in the office, with very different ambient lightning (far or close to the windows, stuff like that). And - as many other have already written - the dark vs light is usually motivated because of contrast issue.

In a low-light environment, your screen is the main light source. Hence you'd prefer a dark theme to avoid making your eyes tired.

In a bright environment, the low-contrast of a dark theme tires your eyes more than a light one, because of its low contrast.

The morale of this story: I learnt that , before trying to customize my dev setup, I should take really more care about my environment, to avoid places that are either too much bright or too much dark (which you can mitigate, with spotlights or curtains), and then, find the setup which better suits my eyes. But to be comfortable, the theme is only a very small part of your global setup!

Michal Stankoviansky's photo

Exactly. Dark themes do look cool and everything, but I work during a day when there's sunshine outside, and since I'm not coding in a basement, I have to go with a light theme, otherwise I just can't read anything.

Oded Arbel's photo

@michal : true - I work not only in well lighted rooms, but also out in the sun - while commuting or at a coffee shop. That's the primary reason I can't handle dark themes - they are just impossible to read in such conditions. The secondary reason why I don't use dark themes is that I use the web a lot - its my second best tool (after my code editor) and most web sites are not very dark theme friendly.

Marco Alka's photo

I prefer the dark theme, because it is easier on my eyes. I am a professional developer, so I am sitting in front of IDEs for some 7h/day. When I come home, I have to look after several projects of mine, meaning a lot more coding. My eyes tend to become very tired and irritated from the white backgrounds. Also, especially when I am at home and it is dark outside, my room is often not lit brightly, so a white screen would be constantly blinding me.

I don't only have a dark theme for my IDE, but I also use a dark themed KDE and I darken all websites using the Firefox plugin "Stylish".

Hugo Mota's photo

It gives me a hacker vibe :DD

Joseph Lloyd's photo

this made me giggle #followed

Jan Vladimir Mostert's photo

I don't, the contrast in dark themes are often less than optimal causing eye strain. A light theme combined with F.lux makes the light theme usable across day and night.

Terminals has to be black and lime green though, one does not simply use a terminal with any other colour scheme :p

Aleksandar Andrijevic's photo

I think it's has to do with how much your eyes get tired when you are looking at something white compared to black or gray, at least I have noticed that is my problem. White background everywhere keeps me tired and bored, and I have to take more breaks when working with dark background.

Clay Constantine's photo

Mainly because it feel better for the eyes. White tends to be too bright and it can hurt your eyes.

Ashish Tomer's photo

It doesn't hurt eyes. White themes hurt eyes after a time.

Maximilian Berkmann's photo

Because the white theme is only suitable in daytime whereas the dark one is suitable for both the daytime and nighttime and it's generally a waste of time and not worth changing from white to black depending on whether it's day/night so coders stick with dark themes.

cedric simon's photo

I also go with dark themes. But I read that dark themes make our eyes pupils open more than white themes. So if our environment is not all the same, watching back and forth light and dark elements is supposed to be as tiring. I use blue light glasses and it really helps. My eye are not tired, or only if i work more than 10h in a row... I'll try Flux as well, could help even more.

Thomas Higginbotham's photo

As others have mentioned, dark themes are easier on the eyes. A white background is similar to staring at a light bulb -- definitely not something you want to be doing for hours every day.

The dark themes have a bit of a nostalgia value as well. I remember learning to program on an Apple IIe, where all you had was a black screen with green text.

If you're used to coding with light themes, it may be a little distracting to switch to a dark theme at first, but after a few days, you'll start to see what everyone means by the eye strain benefits.

Transmission Control's photo

Another reason might be due to the prevalence of semantic code highlighting in modern IDEs. Dark backgrounds have a bit of an advantage if you are looking for several discernibly different and readable foreground colors.

Also, the common reason given may not be the whole explanation even if it is technically correct. Yes, dark backgrounds are easier on the eyes in a dark room but that doesn't explain why so many devs seem to prefer coding in the dark. My hypothesis? Attention Deficit Disorder (dark room focuses you on the screen) and Autism Spectrum Disorders (light sensitivity is a common symptom) are pretty common in techies. Also, a higher proportion of us are likely night owls -- partly because statistically night owls have higher IQs than early birds but also, again, because ADD and ASD favors working in isolation after everyone else calls it a day.

Alvin Konda's photo

The bottom line in my opinion is this. Use "white" when working on high-light environment (on day time and near large windows) and "dark" when working on low-light environments (on night time)

Mark's photo

I read somewhere that black-on-white is more readable, so that's what I use. Not 100% sure about the scientific accuracy, but it's not important enough to spend a lot of time researching.

As for too high contrast, that does bother me sometimes when half a room is very light and the other half is dark, but it rarely bothers me for screens. I use Redshift to change the colour temperature, which is apparently enough.

Adal's photo

It's same reason poets like to stare the stars at night sky. It give divine focus and experience.

Ibrahim Tanyalcin's photo

I prefer old school, black on white, default & bland theme. It does its job.

Turns out white on black background is not that healthy after all: ux.stackexchange.com/questions/53264/dark-o..

To be very honest, I think 99% of devs out there keep using it because they think its cool. I dont give 2 craps about it, if it makes them happy, good for them.