Syntax highlighting is a waste of an information channel (2020)

https://buttondown.com/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/

Syntax highlighting is a waste of an information channel

No newsletter next week Running the TLA+ workshop. No way I'm gonna have any brainpower after that. Syntax highlighting is a waste of an information channel...

Computer Things

I guess I may be an outlier here but I don't find any of those examples motivating at all. They make it harder for me to see the structure of the code at a glance.

Also I think it's a bit off the mark to think of it as being a wasted information channel. Redundancy is a feature of human languages, because our languages are not optimizing solely for density. A bit of redundancy helps our brains pattern match more consistently, almost like a form of forward error correction. Syntax highlighting is like that, at least for me, where it makes a big difference in seeing the structure at a glance, and more overly complex coloring rules thwart that for me. Like I don't want to be trying to match up rainbow shades of parens.

In my experience, the biggest wins in syntax highlighting come from just a few wins: make comments a different color, make strings a different color, and if you've got something like shell where strings can contain embedded variable references, pop those variable references into a different color.

One of the big problems with a lot of the examples here is that, well, I spend most of my time on multimillion line codebases. If you want to pop stuff out to me, showing it in a different color is useless because it's not on the same screen; no, the way you give it to me is a macro that takes me to the next location of the thing of interest. And with a macro that lets me move to points of interest... the use of color is entirely redundant.

I 80% agree with this, but I've also gotten a lot of mileage out of Emacs hi-lock mode. The simplest thing I always want: whatever symbol I'm pointing at right now, highlight everywhere (so I can trace it through the code quickly); more generally, I want to highlight an arbitrary regex, so for instance when I'm auditing a codebase for authorization, I quickly spot the functions that aren't following the same authorization patterns as all the others.