Context Coloring
crockford.com
Context Coloring
1–10 of 21 posts
Re: Context Coloring
#2Disagree with the sentiment behind this. Just because you can read code without syntax highlighting doesn't mean it's useless, or only for programmers who need training wheels. It makes scanning code by eye so much easier, in the way that capital letters make reading this blog post easier.
Re: Context Coloring
#3> Syntax coloring isn't useless, it is childish, like training wheels or school paste Disagree with the sentiment behind this. Just because you can read code without syntax highlighting doesn't mean it's useless, or only for programmers who need training wheels. It makes scanning code by eye so much easier, in the way that capital letters make reading this blog post easier.
Re: Context Coloring
#4Re: Context Coloring
#5What about context coloring the background color and syntax coloring the code? Which maps well conceptually as well.
Re: Context Coloring
#6Colouring by nesting level might be useful in javascript, but strikes me as a poor idea in the other languages I'm using right now (Java, Go, Rust). Nesting is often accidental complexity, and can usually be reduced with a bit of thought. For that reason I'm happy for deep nesting to be visually confusing - it's a useful extra motivator.
(Come to think of it, with async/await, one of the main cause sof deep nesting in javascript can be minimised also).
Re: Context Coloring
#7> Syntax coloring isn't useless, it is childish, like training wheels or school paste Disagree with the sentiment behind this. Just because you can read code without syntax highlighting doesn't mean it's useless, or only for programmers who need training wheels. It makes scanning code by eye so much easier, in the way that capital letters make reading this blog post easier.
Still, it's a novel idea.
Re: Context Coloring
#8> Syntax coloring isn't useless, it is childish, like training wheels or school paste Disagree with the sentiment behind this. Just because you can read code without syntax highlighting doesn't mean it's useless, or only for programmers who need training wheels. It makes scanning code by eye so much easier, in the way that capital letters make reading this blog post easier.
As such the article just reads like a Chesterton's fence - "let's get rid of this thing because I don't see the use of it".
Re: Context Coloring
#9> Syntax coloring isn't useless, it is childish, like training wheels or school paste Disagree with the sentiment behind this. Just because you can read code without syntax highlighting doesn't mean it's useless, or only for programmers who need training wheels. It makes scanning code by eye so much easier, in the way that capital letters make reading this blog post easier.
[0] http://www.ppig.org/library/paper/impact-syntax-colouring-pr...
Re: Context Coloring
#10Not as childish as writing a blog post bragging about how you don't need syntax highlighting to code.
In all seriousness, though: yes, after a while, you don't usually need it. But it's an immediate visual confirmation that I used the wrong type of quote for a string literal, or that I forgot my `def` statement before a python function. Unless you literally never make these errors (or the myriad other little errors that can be caught this way), syntax-aware editor tools like syntax highlighting or auto-indent will save you time by alerting you of your error promptly and letting you fix it without getting distracted. Nothing beats having the whole page suddenly look the wrong color to get your attention.
I actually can't think of a better way to avoid the class of errors that highlighting instantly exposes.
[edit] I do agree with Crockford that extra types of highlighting/formatting for readability can be great, including context-based coloring; emacs's rainbow parens does something similar based on enclosing parentheses, though the interior of the parentheses is still highlighted in the standard way.