🏆 I provide private lessons on Emacs, Linux, and Life in general: https://protesilaos.com/coach/. Lessons continue throughout the year.

Re: How do I protect my eyes when coding? (modus-themes, ef-themes)

I got the titular question and the following message. I am publishing it with permission, without disclosing the identity of my correspondent.

I code 24/7 🙂 as a work and opensource developer. I use emacs.

Are modus-themes or ef-themes perfect for my eyes in such environment, or if not for not straining eyes, what are your customization on present themes.

Thank you

I think you are asking for a software solution to a hardware and ergonomics problem. If you are coding all day, then you do not give your eyes the chance to replenish their energy. The eye is no different than the rest of the body in its need for rest: push it all day and it tires out; do so over an extended period of time and it wears out.

No theme—no single piece of software—will adequately fix a hardware/ergonomics problem. Sure, my themes are designed to be legible, but they cannot prevent you from harming yourself by making inconsiderate life choices. It is you who has to impose structure in your routines. “Structure” here entails taking breaks and paying attention to the needs of the body: you are not a machine.

Please don’t take me wrong. I also get absorbed in engrossing experiences and may write/code for hours on end. But I do take long breaks and do venture outdoors where light and shadow are generally more balanced than in a room.

I strongly encourage you to consider the following non-exhaustive list of items:

  • Always—always!—have an extra source of light in the room, beside that of the monitor. Without peripheral light, the eyes focus on the single source they can discern, which tires them out.

  • Check that the room has plenty of light. Try to have warm lights available at night. If possible, let natural light into the room.

  • Calibrate your monitor’s settings to keep sharpness at reasonable levels. I have noticed many monitors which crank sharpness to the maximum value because that is supposed to give more crisp text. It doesn’t. It is just a gimmick that makes you dizzy after prolonged exposure to text. Max sharpness is a cheap trick to obfuscate the monitor’s actual capabilities. Better apply a moderate value and then consider your typography+theme choices.

  • High contrast themes are great for monitors with limited capabilities. Perhaps the most common remark I get is something like “the modus-themes have effectively upgraded my monitor”.

  • Do not make compromises on typography. Apply the best fonts you can get. For example, if you are using a bitmap font against a light background, you are asking for trouble: it is terrible (ceteris paribus)! Many fonts are not good enough at several point sizes. Their glyphs produce a halo effect which makes them look blurry. When picking a font, first test its working ability and then evaluate its looks. Pretty-yet-unusable is a bad choice (in my opinion that is not “pretty”, but I digress).

  • Adjust your monitor’s brightness based on the levels of environmental light. If you are in a very dark room, lower the brightness so that you are not beaming a strong source of light directly into your eyes. Conversely, set it to its maximum value (or thereabouts) when you are outdoors on a sunny day. Again, when you are in a room remember the point of having additional sources of light.

  • Use a theme depending on the available light. Prefer light themes during the day (given sunshine) or while you are in a well-lit room. In darker environments, opt for a dark theme, without prejudice to all of the aforementioned.

  • Take breaks! Did I mention the importance of rest? Take breaks! Whatever you do in exaggeration, you do it to your detriment.

With those granted, my answer to your question about customisation options is that those are a matter of preference.

Apply the same mindset to all hardware/ergonomics issues. Be prepared for thoroughgoing reforms in your setup and routines. Software alone cannot fix that which is caused by your lifestyle and/or office/work setup.