DEV Community

Why Code in Dark Mode?

Anita Olsen on May 13, 2025

Dark mode was originally the default colour scheme for computers and many people believe that coding in dark mode reduces eye strain (among other t...
Collapse
 
touficmamdouh profile image
touficmamdouh

blue dark mod 😂

Collapse
 
anitaolsen profile image
Anita Olsen

Awesome 😄

Collapse
 
bhuvaneshm_dev profile image
BHUVANESH M

@anitaolsen Because light attracts bugs! 🐛💡

Collapse
 
john_thrush_d56f061bc03eb profile image
HeavyMetalCoffee

For me, everything is set to dark mode. I suffer from chronic and ocular migraines. When I switch something to dark mode, my eyes literally feel relief. It also seems to keep colors from blending.

Collapse
 
thenickest profile image
TheNickest

For a while using dark mode everywhere I can but not in my newspapers apps and some code documentation. This post also made me think to just try out light mode again here and there.. love to have a switch though.

Collapse
 
moopet profile image
Ben Sinclair

themes > modes

I use darker backgrounds for writing code and lighter backgrounds for reading documentation.

Collapse
 
anitaolsen profile image
Anita Olsen

Aha, interesting. Thanks for sharing!

Collapse
 
fmerian profile image
fmerian

@tomayac published an in-depth, resourceful post on the topic back in 2019.

tl,dr on why people like or want dark mode

  • aesthetic reasons
  • accessibility
  • power savings

full disclosure: i'm definitely on the dark side :)

Collapse
 
besworks profile image
Besworks

Syntax highlighting stands out way better against a dark background. That's the main reason. But also I don't just code in dark mode, my whole setup is like a black hole. Goes perfectly with the ThinkPad style. Light mode anything on this makes my eyes feel like they wanna bleed 😎.

dark fury theme

Collapse
 
anitaolsen profile image
Anita Olsen

Wow, that looks cool with all the red!

Collapse
 
besworks profile image
Besworks

The icons are from a handy pack that I found a while ago. They start as white but you can change them to any color with the included script.

Thread Thread
 
anitaolsen profile image
Anita Olsen

Ah, cool! Thanks for sharing!

Collapse
 
georgekobaidze profile image
Giorgi Kobaidze

Used to be a light mode guy. But my eyes never liked bright lights in general, so I decided to give the dark mode a try. Was a bit strange at first, but once I got used to it, never ever looked back.

Collapse
 
pengeszikra profile image
Peter Vivo

Much more less light need for that. On light mode the whole screen is luminating more intensive. I agree @besworks syntax highlight working much fine on dark compare the light or midtone setup.
I start developing a right markdown view specialized the codeblock syntax highlighting even with strange use cases for example a JSDoc where great to make color difference between a casual remmark and types, but that is also true for TS because if IDE give a different colors for types that is a great help for quick code reading.
I also like to use a different bracket colors for a different level.

Collapse
 
alexmario74 profile image
Mario Santini • Edited

Dark mode. Just can't stay in front of a white background.

About the code looking "pleasant" I think that this is the color scheme, not just dark or light. Also the font play a huge role. If you use or not ligatures.

I think that solarized fit good, for the font I'm not so sure which I prefer. Don't like Fira Code too much.

Collapse
 
perisicnikola37 profile image
Nikola Perišić

Better color contrast

image.png

Collapse
 
ben profile image
Ben Halpern

I use dark mode but no big opinions

Collapse
 
anitaolsen profile image
Anita Olsen

Why do you code in dark mode? :)

Collapse
 
davinceleecode profile image
davinceleecode

Doesn't matter if it's dark or light, as long as you're comfortable, then so be it. 😉

Collapse
 
anitaolsen profile image
Anita Olsen

Great answer. I am just being curious that is why. I have also been interested in knowing if dark mode actually is beneficial for health, then I would be persuaded to switch, but I have not seen any good evidence for it so far.

Collapse
 
shimoon profile image
Simon Leprat

I'm on both sides depending of the luminosity context of the room where I'm working.
But I usually find that dark themes are way too dark and light ones are way too bright.. I wish some apps would have basic theme settings like luminosity, warm level and font brightness to be tweaked on the fly so it can be adjusted better for each situations without the need to look for another theme to install.

Collapse
 
marcisbee profile image
Marcis Bergmanis

Tried dark mode for years, but then realised my eyesight was worse at the end of the day. The problem was that I was using dark mode in well lit environment.

Now I use light mode in well lit rooms or outdoors, dark mode when in dark room. Way waaaay better feeling for eyes!

Collapse
 
oculus42 profile image
Samuel Rouse

I started coding on CRT terminals in green or amber and have switched back and forth for decades. It mostly comes down to personal preference and environment. These days I use both. When I'm in the corporate office with big windows and a lot of light, light mode is easier. When I'm coding from my home office in the evening and I don't have the lights on, dark mode is nicer.

Color contrast and syntax highlighting is a theme issue, not so much a color scheme issue.

Supporting both is important to me, though. I have some eye issues that cause double vision or fringing of light sources. When that is acting up it's much harder to read in dark mode, where the individual characters are "light sources" so I either have to zoom in or switch to light mode.

Collapse
 
hexshift profile image
HexShift

I switch between dark and light mode depending on the time of day and how I feel. Dark mode helps me focus during late evenings, especially in low light, while light mode feels more open and comfortable during the day. It is less about eye strain for me and more about overall experience and clarity. That said, I do use a tool called Iris, which adjusts screen brightness and color temperature automatically. It helps reduce fatigue over long sessions, especially when coding at night. Small adjustments like that can make a big difference when you’re staring at a screen for hours.

Collapse
 
csm18 profile image
csm

For me,

  • I started with turbo c/c++ -> blue mode (which i loved as a kid)
  • Then went to code blocks(on linux) -> white mode on! (Back then, didn't knew there was an option we can set!
  • Then came to vs code -> white mode(first),black mode (sticked to it for a while).

Now, I just prefer white mode for c/c++(it just feels good to see and code in white mode).
And prefer dark mode for langs like python,rust for syntax highlighting.The syntax highlighting is visible much clearer in dark mode!

Collapse
 
srbhr profile image
𝚂𝚊𝚞𝚛𝚊𝚋𝚑 𝚁𝚊𝚒

Nahh I code in light mode 💀

Collapse
 
alinarizwan profile image
alinarizwan

I usually code in dark mode, especially during late hours—it feels gentler on my eyes in low light. But I switch to light mode sometimes during the day for better visibility. I think it really depends on the lighting around you and personal comfort. There's no one-size-fits-all!

Collapse
 
saadmanrafat profile image
Saadman Rafat

Why are we discussing this? When you stare at your monitors for 15+ hours, your eyes get tired. When you cross the 10-12 hour mark. The blue light seems like it's hurting my eyes. So yeah that's where you go Dark Mode.

Collapse
 
shricodev profile image
Shrijal Acharya

+1

Collapse
 
gerolori profile image
Lorenzo Gerosa

The fact that this is a matter of preference is ok but I also think that people pick a side and die with it.
I think that approach is completely wrong. Screen brightnees (and night light mode too) should follow the circadian rithm, mimicking the movement of the sun. 10 years ago it wasn't possible but now it is, there's plenty applications for any os to auto switch the system theme to dark/light on sunrise/sunset, this makes a seamless integration between your room and the outside, getting the best of both worlds (more attentive with light background during day, less eyestrain and ease into tiredness in the evenings).
This could probably be used to sqeeze extra performance from your brain, faking brighter light for long (but this also needs a stronger artificial light in the room too). Anyway I wouldn't recommend it to anyone for any reason.

TL;DR: use system theme auto switchers based on sunrise/sunset and set all your applications to follow your system theme. you'll be amazed

If we're talking about mobile devices so smartphones (especially with oled screens) and laptop, then there's clearly a benefit in switching to dark mode in a battery saving perspective, but at the price of worse contextual readability

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

Honestly, I switch it up all the time but gotta say light mode hits different when the rooms bright.

Collapse
 
nicole_smith profile image
Nicole Smith

Hahah, I'm finding this comment. I also switch it up frequently. Dark mode is novel for me to try - fresh visuals, while I‘m used to working in light mode.

Collapse
 
anitaolsen profile image
Anita Olsen

I think you are right. I usually code mostly in the morning.

Collapse
 
prashant_chaute_2f9e247ec profile image
Prashant Chaute

Coding in Dark Mode can reduce my eye strain, especially during long sessions or in low-light environments. It helps improve focus by reducing screen glare and is easier on the eyes at night. Additionally, it can save battery life on OLED screens and offers visually appealing syntax highlighting for better readability.

Collapse
 
nevodavid profile image
Nevo David

Been using both but honestly I always come back to light mode too - it just feels right on my screen.

Collapse
 
anitaolsen profile image
Anita Olsen

It most certainly does! I agree.

Collapse
 
volker_shamburg_0f1ab48c profile image
Volker S.

Why do programmers prefer dark mode?
Because light attracts bugs.

Collapse
 
anitaolsen profile image
Anita Olsen

Welcome to DEV by the way! :)

Collapse
 
anitaolsen profile image
Anita Olsen

Hahah, yeah, that is a good one 😂

Collapse
 
best_codes profile image
Best Codes

I just like how it looks, and it also (though not very noticeably) saves battery life. I also don't like the glare from white screens!

Collapse
 
rahulkumarmalhotra profile image
Rahul Kumar

I read in light mode most of the time and I love to write or code in dark mode. My eyes are very sensitive towards light.

Collapse
 
ironside43 profile image
Smit

Oh, I definitely agree! Dark mode is the best, especially with the icon packs in the editor. It’s easier on the eyes and boosts productivity, particularly when visualizing data in Python!

Collapse
 
avanichols_dev profile image
Ava Nichols

I think a lot of people think it's easier on the eyes, but there's definitely a cultural dynamic to it. More "hardcore".

Collapse
 
subhadip_paul_adb2c789fbd profile image
Subhadip Paul

I like how the class name colors pop in darkmode

Collapse
 
captainsolo23 profile image
Ivan Arellano

I use a VSC theme which emulates the old IBM 3270 terminal colors, I feel comfortable in the dark haha

Collapse
 
wakeup_flower_8591a6cb6a9 profile image
Wakeup Flower

I still use Hello kitty mode sometimes, they told me it stings the eyes

Collapse
 
anitaolsen profile image
Anita Olsen

Hahah! =^.^=

Collapse
 
capricair profile image
Alex

Too much light will increase the consumption of photosensitive substances in the eyes I think

Collapse
 
praciano profile image
Tarcisio Praciano-Pereira

What is "dark, light" mode for coding?

Collapse
 
anitaolsen profile image
Anita Olsen

Dark mode and light mode are colour schemes. Whenever you use an editor, it is usually in either a dark mode or white mode. Dark mode uses a black background with white text and light mode uses a white background with black text.

Some comments have been hidden by the post's author - find out more