Live data from Hacker News

Syntax Highlighting Off

robertmelton.com

31–40 of 110 posts

Re: Syntax Highlighting Off

#31
Some people are definitely in the camp against syntax highlighting.

Some examples:

1. Linux Akesson (LFT) wrote an article quite some time ago about it: http://www.linusakesson.net/programming/syntaxhighlighting/

"A case against syntax highlighting:

Do you rely on syntax highlighting when developing software? If so, you may be shooting yourself in the foot. In this post, I will argue that syntax highlighting, while aesthetically seductive, moves focus from content to form, and discourages those who look at the code from trying to understand it."

2. The Acme text editor does not support syntax highlighting and probably never will. Prominent contributors to golang use this editor.

On my own, I started to program without syntax highlighting, then used it and now I use a much weaker one. I like to be able to track individual variables by color as a form of semantic highlighting and to bring up comments rather than dimming them like it's often done.

Re: Syntax Highlighting Off

#32
This post misses, for me, the greatest benefit of programming without syntax highlighting enabled. I went through a period of doing it for 5 years or so and the biggest effect was ultimately on how I wrote code, not how I read it.

Without syntax highlighting I gradually became more focused on the legibility of what I was writing, because none of the visual cues were there when I read stuff back. Function length, module size, naming and vertical whitespace were are all things that I began to think more deeply about.

I turned syntax highlighting back on a few years ago because I was getting so many complaints from co-workers when pairing on stuff at my machine. But I definitely think the experience made me a more considerate, better programmer and I'm glad I did it.

Re: Syntax Highlighting Off

#33
No thanks.

I started using syntax highlighting still in the MS-DOS days, and hate when I am forced to downgrade my developer experience.

But to each its own I guess.

Re: Syntax Highlighting Off

#34
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…

>I don't understand the reasoning behind this. What possible benefit could you get from turning off all syntax highlighting?

He explained his reasoning (and theories why it would work) in enough detail. You might disagree, but I can't see how you can't understand it.

>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.

That's the conventional thinking. The whole point of TFA is that it's not useful -- rather it's distracting, making eyes automatically focus in such distinctions while losing the bigger picture.

Plus, just because you've colored "language keywords and user specified names" doesn't mean it's now easier to "visually ignore" one of them while focused on the other, it can mean the exact opposite: the extra color distraction makes you jump from one to the other -- unless you put extra conscious effort.

Re: Syntax Highlighting Off

#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.

Re: Syntax Highlighting Off

#36
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…

I have been without syntax highlighting for two years now, and I don't miss it. Have tested using it again, but feelt it distracting. For me the main advantage is that without the colours it is easier to see when a certain part of the code is 'ugly'. With syntax highlighting on, everything is a soup of colors anyway. Also, when highlighting makes comments light gray and almost invisible, it is easy to leave a commented-out mess of old code around. When comments are given the same emphasis as real code I care more about them, and make them tidy too. I don't find the extra information provided by colours useful. I'd rather spend five seconds going back to the declaration of the variable (in my editor, it is a simple right click to jump between usages of a string), which will also remind me of its type and the context it was introduced, since if I am unsure about its scope, chances are there are more aspects of the item which I am unsure of.

Re: Syntax Highlighting Off

#38
I can't recall who, either Pike or Crockford said that syntax highlighting was a regression. I kinda agree that a well balanced comment code ratio, and clear system / design makes up for most editor enhancement.

Re: Syntax Highlighting Off

#39
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…

this, for me, is a frustrating aspect of programming from a user's perspective

when someone builds something they often 'hard code' their own specific interests into the thing

so let's say i am like you, and only want the comments highlighted.. if the highlighter i am using fails to allow me to alter it from the user side of things i'll have to dive into the source

if it is closed then i have to take the time to build my own wheel

if it is is open, but after investigation i find the functionality is hardcoded, piecemeal, and highly specific then i have to take the time to build my own wheel

this is an overly simplistic example of what i am trying to illuminate but from a user's perspective there is a huge difference between these equations:

    print(51)

    n=3*17
    print(n)

    a=3
    e=17
    print(a*e)

    a=sys.argv[1]
    e=sys.argv[2]
    print(a*e)
for highly configurable designs just pulling flags from the command line will get out of hand quickly but it would be superficial to have a function that allows the user to see the programs state and alter it to their needs

Re: Syntax Highlighting Off

#40

I've had syntax highlighting enabled in Vim for many years without really thinking about it. I just recently started to learn a new programming language (Go) and that got me thinking about the effects of syntax highlighting. I felt that colours would distract me from efficiently learning the syntax of the language so I turned it off for a while, now I'm never going back. (I really do like having another color on just…

For me, it really helps to have code and comments the same colour. That way I give comments the attention they deserve, and I can resist the temptation to comment out code.
Post reply on HN