by thisisblurry on 7/18/19, 3:09 PM with 20 comments
by stefco_ on 7/19/19, 6:04 AM
Not 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.
by skeoh on 7/19/19, 4:13 AM
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.
by crispinb on 7/19/19, 4:38 AM
Colouring 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).
by flukus on 7/19/19, 6:20 AM
And if syntax highlighting is training wheels and context colouring is better, does that make it your dad holding the back of the seat?
by epicureanideal on 7/19/19, 4:28 AM
by wayneftw on 7/19/19, 2:29 PM
What kind of sentence is that? Maybe it's saying we can better perform some activity that was mentioned in the previous sentence? Let's look at that:
> Syntax coloring is very popular, especially with coders who still struggle with basic syntax.
So, "I think we can better...struggle?" Hmmm.
Perhaps the Crock would have done better with some English syntax highlighting such as the kind commonly found used in spelling and grammar checkers.
by dusted on 7/19/19, 6:41 AM
If I were to turn the table on the author, I'd say he has a problem keeping track of simple scoping and tries to cope.. I would suggest he turn on the indentation markers in his editor, that's what he wants. Though he should be aware that in some languages, context is much more complex than indentation, and that's the kind that'd be interesting to highlight, for example, by changing background color.
--
Ps, I wrote my first many klocs in windows notepad, so it's not like I was brought up on syntax highlighting and can't get past it, it's just that I've learnt to take advantage of a richer environment (vim).
by chownie on 7/19/19, 10:28 AM
I can use syntax highlighting to snap eyes to the correct pattern I'm looking for, I can't really discern the value in large coloured blocks of text though. I can already work out what part of code that is by the rough shape of the block before I even start reading it, why would you need to colour it in?