3 ms·
Syntax highlighting works because colour components are preattentive i.e. your brain picks out hue, saturation, intensity/luminance differences in constant time
by lucozade 11y ago
Syntax highlighting works because colour components are preattentive i.e. your brain picks out hue, saturation, intensity/luminance differences in constant time. Size, proximity and orientation work too.
That's why some schemes work better than others: what you want to find quickly is key structural signals in the code. If you highlight comments strongly, say, it'll miss the point (unless your proof reading comments of course).
So, to your question, the value will depend on whether or not there are structural cues that it'd help sufficiently to highlight.
Interestingly we do do that to some extent already. For example, indenting and capitalising the start of sentences, indenting (and spacing) paragraphs, italics and bolding for emphasis. That sort of thing.
So using highlighting in the places we currently do could well improve what we already have. For example, colouring the first word in a paragraph or increasing the font of the sentence capital.
What would be fascinating to study would be if we could use it to help with word or sentence stress. I could imagine that, done carefully, this could help with learning languages.