laristine
11 hours ago
> Here’s a quick test. Try to find the function definition here
It's funny that in the first example where the author asked the viewers to find the function definition, I was able to do so faster with the colorful syntax highlighting he considered wrong.
To recognize different elements of code is more than just colors, but actual syntaxes of the language and the general shapes of code blocks.
It's a matter of taste, and in my decades of programming, I've found colleagues and many teams trying for all kinds of fancy themes only to come back with a "boring" one, like Material Theme, which is also my main driver nowadays.
I think the author had some good ideas, particularly around literals (what he called constants), rejection of the requirement for equal brightness, and emphasizing comments. The author is more than welcome to bring his version of perfect syntax highlighting to the market of ideas. Its adoption should prove it if his idea wins.
tagraves
11 hours ago
I had the same experience -- it was way easier for me to find it with the rainbow highlighting (even though I already knew where to look when it came to the monochrome highlighting!).
The author later asks what color class definitions were. I think this fundamentally gets wrong how syntax highlighting helps humans. I don't have a clue what color anything is in my favored highlighting, but my brain does incredible pattern recognition to help me digest code in it without me consciously knowing what color does what.
So his arguments for why there's a problem don't hold up, but that doesn't mean there is not in fact a problem.
thewebguyd
10 hours ago
Yeah I certainly dont' pay attention to or remember what color means what.
I am however in that weird minority that prefers light themes, and I do also prefer minimal syntax highlighting. The author does have a point to an extent, but I don't think there's any one objectively better way to do it I think it's all personal preference.
I don't like the rainbow highlighting, too distracting for me, and doesn't work particularly well with light themes. I did try the author's alabaster theme in VSCode though and it highlights the wrong things for me.
(In C#) if I have var result = await SomeMethodName(param, param, param); It put both "result" and "SomeMethodName" in blue, the rest being black. I'd actually prefer it the other way around, highlight the programming language's keywords (var and await in this case) and leave my own names (result and SomeMethodName) unhighlighted.
The theme was also inconsistent. The post says we shouldn't highlight PL keywords, but the proposed theme does highlight some keywords while ignoring others.
jchw
11 hours ago
I agree. I was baffled when I realized I was supposed to struggle with that example.
I do agree that it is harder to see the return misspelling with the more detailed syntax highlighting, but when I'm coding I'm mainly focused on the actual tokens I'm writing, and you better believe I pick up on if the syntax highlighting is showing my token as wrongly being a keyword rather than an identifier, or the wrong type of identifier. Even if I don't actually know what the colors are, it will look wrong.
Rainbow vomit syntax highlighting logically seems like a bad idea, but like many things, even though it's hard to prove that it's better, I think a lot of people will agree that it really is better. Especially with tree-sitter and LSPs giving more detailed syntax highlighting; I can feel the benefits of 'oh, that's the wrong identifier color, isn't it?' to the point where if I run into an edge case that breaks highlighting it becomes immediately noticeable.
wijwp
11 hours ago
I wonder if OP has some kind of color blindness that makes his examples make more sense?
I am able to parse the status quo example way better than his ideas.
My theory is helped by his use of a yellow background on black text, which is horrific to read.
btown
10 hours ago
To this point, I wonder if we can go even further in the direction "it's fine to have a 'zoo' of colors on the screen... as long as we're able to rapidly scan for patterns based on the shapes of code and relative positions of those colors."
Many games (especially gacha games where one may be tracking multiple orthogonal "levels" on any given piece of inventory) compress tremendous amounts of data into a character or gear item portrait; ticks on the top, dots on the side, colored frames, etc. - all so we can pick things out in a crowd without needing to set a custom sort order.
And yet our IDEs, citing silly things like "render optimizations" and "consistency with ANSI escape codes," allow each character to have just a single foreground color, a single background color, and maybe a squiggly underline. Why stop there?
Give me the freedom to add arbitrary overlays and decorations on any given token. Give me <ruby>-style elements [0] that will let me put a little colored dot or emoji at the top right of any token that meets a certain requirement... say, a utility function, or a reference from the file that's open at the top right of my screen.
Let us swim in rainbows with sparkles flying past our eyes. We're strong swimmers.
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
Neywiny
11 hours ago
This is like, it might've been a Veritasium video? There was some YouTube video that started with a test, and the rest was predicted on one outcome but myself and most of the audience had a different one. At worst just read the code normally, at best you can jump to specific colors
surgical_fire
10 hours ago
> It's funny that in the first example where the author asked the viewers to find the function definition, I was able to do so faster with the colorful syntax highlighting he considered wrong.
Same. It sort of killed the article for me. I also thought that in his resulting theme the limitation of colors would eventually trip me up. Having numbers and strings be the same color is terrible - I have noticed mistakes in the oast where numbers were erroneously attributed as strings for being enclosed in quotation marks precisely because my theme gives those different colors.