July 20, 2020 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 No, not a waste in general. Syntax highlighting is quite useful. I'm saying it's a waste of an information channel. Here's a quick demonstration of what I mean. Here's 399 squares and one circle. Where's the circle? Round two. Where's the circle? Color carries a huge amount of information. Color draws our attention. Color distinguishes things. And we just use it to distinguish syntax. Nothing wrong with distinguishing syntax. It's the "just" that bothers me. Highlighting syntax is not always the most important thing to us. The information we want from code depends on what we're trying to do. I'm interesting in different things if I'm writing greenfield code vs optimizing code vs debugging code vs doing a code review. I should be able to swap different highlighting rules in and out depending on what I need. I should be able to combine different rules into task-level overlays that I can toggle on and off. I've listed some examples of what we could do with this. If this is something that already exists I included a link. Otherwise I included a mockup. Some of the examples have implementation issues beyond what I discussed; they're just demonstrations of what highlighting could be. All examples are Pythonish unless otherwise noted. Some Use Cases Rainbow parenthesis This is a pretty common one. We can use different colors to mark how nested a set of parenthesis are. From here. Context Highlighting Highlight different levels of nesting. From here. Import highlighting Highlight identifiers imported from a different file. Variations: Highlight imported functions and classes differently Highlight qualified imports Highlight imports from particular trees Argument Highlighting Arguments passed into the function are highlighted differently from local va...
First seen: 2025-10-16 20:50
Last seen: 2025-10-17 11:52