Live data from Hacker News

Syntax Highlighting Off

robertmelton.com

71–80 of 110 posts

Re: Syntax Highlighting Off

#71
Former neuroscientist here. Please take this article's pop science proclamations with a grain of salt.

1) "Additionally, we process words much faster than we process colors". Wrong, I'm pretty sure areas V2/V4 received information much faster than the visual word form area, especially given that it may require a saccade to take in a long word. Not sure where this claim comes from.

2) "...we instinctively jump to luminous or high contrast colors with our eyes, interrupting reading a program in a more standard way..." Half-true. There are well-known pop-out effects, but it's unlikely we read programs the way we read prose, so it's not clear it's an interruption at all.

3) "When syntax highlighting is on you also are spending cognitive energy (which is finite) on item-specific processing rather than organizational processing." No evidence offered. I could just as easily make the counter-claim, that syntax highlighting frees up the brain to more organizational processing, since there's less load necessary to figure out item-specific properties. Not necessarily wrong, but needs to be tested.

I think the biggest mistakes in the article (and perhaps what he got from talking with his friend in the cognitive sciences) are equating prose with code, and not accounting for novelty effects. I have no doubt that coloring random words in prose disrupts things, since it's novel and captures attention. But it doesn't automatically follow that people experienced with syntax highlighting experience similar effects.

It would be cool to see more actual research in this area.

Re: Syntax Highlighting Off

#72
post #45

Earlier quoted context omitted.

Yes, I read his reasoning, but I still can't make sense of it. The most common theme seems to be that having more colors is "distracting". I mean yes, having more colors gives your eyes more things to process... the same way that 7 letter variable names creates more work for your eyes compared to 2 letter variable names. But if someone told me that they avoid naming their variables using complete words because it's t…

I found the Alice in Wonderland image at http://www.linusakesson.net/programming/syntaxhighlighting/ particularly compelling, in support of the argument that highlighting may emphasize syntax at the cost of obscuring semantics.

As the author himself points out (though after making an argument that implies the opposite), code is not prose. Prose has its own base elements, such as phrases and titles, and it does use visual cues to point them out, such as capitalization and larger fonts.

Re: Syntax Highlighting Off

#73

Earlier quoted context omitted.

A step up from ed but a step below vim is nvi. I've always preferred nvi over vim because: 1) there's no lag when I scroll up or down through a file line-by-line, 2) it shows a list of matching files by default when using tab completion in command mode (same as bash), vs picking the first matching filename, and 3) it uses fewer resources when you screw up ( http://galexander.org/vim_sucks.html ) I used to think that…

Re 2) set wildmode=list:longest EDIT: Re 3), there's something weird going on. I just tried the benchmark from the article that you linked ("1000000aaeou "), and it really did not complete in a useful timeframe. However, when I insert the text once, yank it, then paste it with repeat ("iaeou ^y4l1000000p"), the operation completes instantly, and I can still browse the file without any slowdown. Undo/redo across this…

Thanks for the list hint!

Re: Syntax Highlighting Off

#74
post #49

Purely eye candy here--visual enjoyment that makes code seem more interesting and fun. Did anybody else go from needing a white background, to preferring a dark one? (I had the zebra effect for years when trying to read light-on-dark, then one year something changed--I don't know exactly what.)

went dark years ago, never looked back.

"one year something changed - I don't know exactly what" - you matured:)

Re: Syntax Highlighting Off

#75
post #35
post #29

I don't understand the reasoning behind this. What possible benefit could you get from turning off all syntax highlighting? It's useful to distinguish between language keywords and user specified names. Being able to visually ignore one of them, while focusing on the other, is a tremendous benefit. It cuts down the number of things you need to hold in your head at once, by half. It's useful to distinguish between loc…

It is an hipster thing, coding without syntax highlighting, no completion, only CLI and the original Vi.

or it is a reaction to too much syntax highlighting, overloaded toolbars, endless contextual menus and general sophistication that penetrated every pore of software development.

as one of the comments here quoted: "syntax highlighting, while aesthetically seductive, moves focus from content to form". Sums up the state of art in IT.

Re: Syntax Highlighting Off

#76
post #70

Earlier quoted context omitted.

One of the most important benefits of syntax highlighting that no one in this thread seems to be discussing is the highlighting of syntax errors. That is the number one benefit of syntax highlighting for me. It immediately shows me where there's a problem in my code (like if I haven't closed parenthesis or quotes) and keeps me focused on "completing the thought", as it were. This is also a reason that I don't like us…

Highlighting of errors is, for me, something distinct; a background parse / compile process that reports line numbers is sufficient. It doesn't need deep integration with the editor. A keyboard shortcut to go to the next error and you're pretty much all set. I'm also not a big fan of overly eager syntax checking because I tend to compose abstractions on the fly, leaving a statement incomplete while I flesh out a depe…

Autocompleting is by far my biggest pet peeve in modern IDEs. With default settings in Jupyter, for example, typing """ immediately creates another """. Another great one is when autocomplete tries to be vindictively clever and often deletes your open parentheses if you delete its closed parenthesis. Complete concentration killer.

Re: Syntax Highlighting Off

#77
post #24

I'd freely speculate that 90% of the benefit of syntax highlighting comes from mere lexical highlighting - specifically, making comments, strings and keywords visually distinct from everything else. And even keyword highlighting is very secondary to the first two. Making comments distinct from normal code is nice because you can easily alternate your focus on one or the other while reading through; and you're not lik…

One of the most important benefits of syntax highlighting that no one in this thread seems to be discussing is the highlighting of syntax errors. That is the number one benefit of syntax highlighting for me. It immediately shows me where there's a problem in my code (like if I haven't closed parenthesis or quotes) and keeps me focused on "completing the thought", as it were. This is also a reason that I don't like us…

> It immediately shows me where there's a problem in my code (like if I haven't closed parenthesis or quotes) and keeps me focused on "completing the thought", as it were.

Funny, because I dislike having syntax errors highlighted for the exact same reason. If I'm typing new code, I like to keep my thoughts on the reasoning behind what I'm typing, and leave it until later to "clean up" the code and get it syntactically correct. Having big red highlights around code that I haven't finished writing yet is a huge distraction... the editor seems to be beckoning to me: "Stop typing and close that paren! Why are you still typing! It's not corrreeeeect yet!!!". And usually it's enough distraction to cut off a good train of thought.

It gets worse when the editor starts complaining about full compilation errors, like calling functions I haven't written yet. When I'm in a more "creative" part of my coding (like when I'm doing lots of brand new functionality), there's a certain ordering of what I write first and what I fill in later, and having an IDE yell at me the whole time is just tiresome.

Re: Syntax Highlighting Off

#79
I went the other direction, I programmed for decades without syntax highlighting because back in 1989 I thought ANSI color directory listings were for MS-DOS weenies, so I used a monochrome terminal for everything. I finally became a software developer and adopted syntax highlighting and haven't looked back. Catching unterminated strings and mismatched do..end blocks in ruby saves an incredible amount of time where you can just fix it immediately in-editor as you are coding.

I find it amusing that now we've got hipster programmers wanting to get back to basics and reject syntax highlighting. Trust me, its not better, colors do make you more efficient.

Re: Syntax Highlighting Off

#80
post #35

Earlier quoted context omitted.

It is an hipster thing, coding without syntax highlighting, no completion, only CLI and the original Vi.

or it is a reaction to too much syntax highlighting, overloaded toolbars, endless contextual menus and general sophistication that penetrated every pore of software development. as one of the comments here quoted: "syntax highlighting, while aesthetically seductive, moves focus from content to form". Sums up the state of art in IT.

I have been using syntax highlighting since Turbo Pascal 7.0, it has never been a problem.
Post reply on HN