Slightly off topic, but I think doing this could actually be useful for learning languages, especially highly inflected ones (if you extend the color coding to account for gender, case, etc.).
He could lead if he would get the lead out.
A bass was painted on the head of a bass drum.
That that that that boy said is not that that that that boy said.
Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.
Maybe what we want to do is emphasize the few lines that matter the most. Right now, we try to break the methods down into smaller and smaller pieces, resulting in the “In Smalltalk, everything happens somewhere else” syndrome.
Likewise, highlight macros in C and make them different to variables/functions.
You can see here that the Monokai theme supports about 20 tokens and doesn't differentiate much between scopes: https://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai
Personally, I prefer highlighters that do something to highlight variables differently, like this variant of Monokai (ie around line 45 for the JS example): https://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai...
What you are describing sounds like regular syntax highlighting to me. This is my current theme: http://imgur.com/a/cQbWL You can see the level of customization available fits with what you described.
And it has really helped many times in the past, preventing all sorts of silly mistakes that could have been hell to debug. Like shadowing a variable :)
I've had a similar thought for several years now. Want to hash out some ideas? You can contact at my site wanderingstan.com or on twitter @wanderingstan.
There was a book on this, whose title I'm blanking on. Anyone remember? Color wasn't an element, since it was an older book focusing on printing on paper.
- Who the hell would write prose by making all the verbs blue, the nouns red, and the adverbs green (or something to that effect). That's what we do for code. Something togglable a-la iA Writer might make sense, though. At the same time, I can sort of understand, though, because we're almost always in "edit" mode for code, very rarely in pure "write".
- I find having lint-errors highlighted provides a similar nudge to the "squiggly-red underline spellcheck".
- Our editors aren't configurable enough with regards to typography. I like to use subtle weight changes, highlighting "headings" and whatnot, and very few tools seem to make that change available.
- Semantic highlighting seems super interesting, but I haven't found a tool that I like yet.
One project I'd love to see is to get a bunch of folks together to do some proper layout-by-hand on code -- Given 100% control over typography, how would you format it to maximize readability, minimize distraction, highlight relevant contextual knowledge, etc? And then work to push tools in a direction that they support configuration to allow for said tasks.