| ▲ | D-Machine 4 hours ago | |
Code can be read without any syntax highlighting or text decoration, obviously. But adding those things is an additional information stream that makes processing faster and more reliable (redundancy in general has this effect). As you said, it is especially useful for making certain code smells instantly visible at a glance. I also find that different kinds of code will get different "color rhythms" (e.g. low-level algorithmic code vs. high-level code that calls a lot of functions vs. code that does a lot of operations / mutation of object or class properties) when syntax highlighting is properly semantic. This makes scanning for certain types of things (where objects are being mutated, where variables are introduced, etc) extremely fast, since you don't even need to read the characters. I also find that rich syntax highlighting makes the codebase easier to remember, since the color (along with things like the line-lengths) gives each function a sort of unique visual texture. Of course, all of this is personal preference. I am a very visual thinker so this kind of stuff helps a lot for me. Some people are far more verbal in their mental imagery or may remember code chunks solely based on semantics. Then, obviously, a bunch of color and/or text decorations might not matter much, or even just be a distraction. | ||