• Should You Really be Coding in Dark Mode?
  • Original author: Saji Wang
  • The Nuggets translation Project
  • Permanent link to this article: github.com/xitu/gold-m…
  • Translator: kamly
  • Proofread by: Zz Zhaojin, Kim Yang

Should you really be coding in dark mode?

In user experience development, there are few debates as contentious as color patterns. Among developers, however, there seems to be a clear tendency to code in dark mode. The survey found that two-thirds of the developers surveyed preferred to use dark mode in their code editors.

Dark mode advocates cite a number of benefits, including reduced eye strain, improved sleep and reduced power consumption. While many of the arguments for the dark model are undoubtedly valid, scientific consensus on its many benefits is far from complete.

An episode in history

While we may think of dark mode as a relatively new trend, it’s actually a color scheme originally used in computers. Most early computers used light-colored text on a dark background to save power. However, as computers became more consumer-friendly, developers began using black text on a white background to mimic the black ink on white paper that most people were used to.

Recently, countless devices, websites, and apps have added support for dark mode for both optical and aesthetic reasons. Software developers, who spend most of their working days staring at computer screens, have been among the most fervent advocates of dark mode.

1. Eye strain and readability

The first argument for dark mode is worth looking at, namely that dark mode is better for your eyes. While there’s no doubt that using light patterns in a dark room can be dazzling, there also seems to be evidence that our brains are better at reading and understanding black text on a white screen.

For example, a 2013 study by psychologist Cosima Piepenbrock, Ph.D., looked at visual acuity and proofreading in dark-colored and light-colored scenarios in adults with normal vision. The study found:

“Pupils were smaller and performed better in positive polarity (dark versus light) than negative polarity (light versus dark).”

In other words, for substantive digital tasks that focus on reading text (like coding), having dark text on a light background (e.g., light patterns) can help you focus and understand better.

This practice means that if your IDE is in dark mode, your eyes and brain may have to work harder to read and write code.

Blue light and sleep

Another oft-cited claim is that using your IDE in dark mode reduces blue light damage and therefore can help you sleep. While dark mode certainly reduces blue light, blue light may not be the main culprit that really disrupts your sleep schedule.

A 2019 study from the University of Manchester found that blocking blue light only slightly improved people’s sleep patterns. Instead, the real culprit is using warmer colours (such as reds and yellows) at night, which tricks our brains into thinking it’s daytime.

If you want to get a better night’s sleep, dark mode may help objectively, but the real solution is to not use screens at all before bed.

3. Power consumption

Another argument for using dark mode in your IDE is that it can save you money on your electricity bills. If you’re using an OLED display, which is what most modern displays are, yes.

However, it may be important to note that if you’re developing computation-intensive software, such as rendering 3D graphics or training and using machine learning models, the reduced power consumption of dark mode may not have any noticeable effect on your electricity bill.

4. Accessibility

No matter what you personally like when coding, you should add support for dark and light modes to the software you build. Many people with some color blindness or eye problems will find one of these topics very difficult to use or even impossible to use. Therefore, it is important to provide flexibility to your users.

conclusion

All in all, the jury is still out on whether dark mode is actually better for coding. While it may save you a small amount of electricity, and if you use it at night, it may help you get a little more sleep, the benefits don’t seem all that substantial. Also, black text on a white background may help you read and write code more effectively.

Therefore, your topic should boil down to what works best for you, as there is no scientific consensus that one color scheme is better than another. If you think dark mode looks more stylish and you do a lot of coding at night or in the dark, stick with dark mode. If you like the readability of dark text on a light background, stick with light mode.

So, which model do you prefer and why? Personally, I think dark mode is more aesthetically pleasing, but I’ve certainly noticed that it can be harder to read.

Let us know what you think in the comments!

If you find any mistakes in your translation or other areas that need to be improved, you are welcome to the Nuggets Translation Program to revise and PR your translation, and you can also get the corresponding reward points. The permanent link to this article at the beginning of this article is the MarkDown link to this article on GitHub.


The Nuggets Translation Project is a community that translates quality Internet technical articles from English sharing articles on nuggets. The content covers Android, iOS, front-end, back-end, blockchain, products, design, artificial intelligence and other fields. If you want to see more high-quality translation, please continue to pay attention to the Translation plan of Digging Gold, the official Weibo, Zhihu column.