| LOOKING AT CODE LIKE LETTERS IN A BOOK
In 2023 I configured my own Emacs theme, monochwome. I made it as an
homage to the amber coloured glass teletypes of days passed. How
romantic they look, right? I know the green ones are the most popular
and iconic. But if I were alive back then I'd be sitting in-front of
warm, cozy amber.
|
|
The theme started out expressly intended to derived all highlighting
and other color aids from a single preset hue, `orange'. (At the start
the theme had a different name, though I can't recall what). But I
soon realized that the theme should be easily adaptable to any hue:
`green', `blue', `purple', whatever. That's `monochwome' as it is now:
configurable to derive all colors from a single user selected seed
hue.
|
|
Towards the end of 2023 I switched from using Emacs in X to using
Emacs in a urxvt buffer (`emacs -nw', the command I lovingly
invoke). The amber version of monochwome didn't look all that great in
a terminal, so I stopped using it. I ran with `modus-vivendi' instead,
and I stopped giving a damn about what my editor looked like.
Then, a confluence of factors started to shift me away from syntax
highlighting. Influences on IRC and gopher proclaimed the benefits of
monochromatic coding. I started using (and loving!) less and ed(1) for
writing programs and reading code. Slowly, my preconceptions that
syntax highlighting is an aide to my work eroded. And then I finally
realized: dang, color in my code really *is* annoying.
At first, I adapted Emacs by simply disabling `font-lock-mode'. But
that was a bit too harsh of a change. There are a few aspects of
Emacs' typography that are nice to look at, like how links in
`org-mode' are shortened. So I looked for theme packages that could
set my Emacs into black and white instead. And then I remembered
`monochwome'! It was never intended to be used with shades of
gray. But to my delight and surprise it looks great! See for yourself:
|
|
In fact, monochwome looked good for other hues too, even though Emacs
was run in a terminal. I can only think I must have messed up some
customization variables, or had multiple themes applied causing weird
styles, which initially made monochwome look awful. Oh well.
Anyways, I don't just want to detail my little journey away from
syntax highlighting. I want to add meaty substance to this timeless
conversation about programming without syntax highlighting. I want to
suggest that there's a relationship between reading a book and coding
in monochrome. Further: I want to propose that this experience is
literary. Indeed: that coding is inherently a literary adventure, and
that getting rid of distracting colours is a way to strengthen the
impact of the text. Reading and writing code that's shown in an
underwhelming amount of color forces your brain to fill in the gaps,
like it does when reading a book. You must use your imagination. And
as a consequence you get a more vivid experience of programming.
Computer programs are like chapters in a story, and the entire history
of computer is this ever expanding interactive epic to which they
belong. A person can simultaneously read and write to the epic as it
unfolds. If you want, you can even contribute your character and
dialogue to the many plots unfolding in parallel like Linux, PHP,
Common Lisp, C, whatever! Coding au naturel is the way this story is
meant to be typeset. It's the platonic form of code---everything else
is lipstick on the gorilla: cosmetics that occlude the actual form of
the creature beneath.
So here's my pitch for those who don't code in monochrome to do it: if
you like reading, if you like using your imagination, if you're like
me and your thoughts and feelings are most vivid when your brain has
to fill in the gaps, then you will love coding in the nude---no fancy
fonts, no bright colors, no syntax highlights. Just text on a page, as
simple as you can get it, like a dog would see it. Give'r a go! If you
don't take immediately stick with it, struggle, and then experience
the freedom and vivid experience of your brain muscling around the
banalities of white text on a black page. It's truly something. You'll
be able to pick up any old piece of code and turn it into a
magnificent, captivating theater of the mind... |