DEV Community

Turning off the syntax highlighter

Huy Tr. on October 12, 2017

Well... first of all, this is a well-known topic that widely discussed everywhere already. [1] https://www.robertmelton.com/project/syntax-highli...
Collapse
 
codemouse92 profile image
Jason C. McDonald

Won't venture to disagree with others' results, but turning off syntax highlighting would be detrimental to me. Due to my dyslexia, I rely on it heavily to help me visually parse code, and catch typos early.

Collapse
 
prodigalknight profile image
RevanProdigalKnight

I'm not dyslexic, but I also find that syntax highlighting helps me catch typos early. The more distinctly colored different segments of text are, the better, in my opinion.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Well, at least you have good taste in music! :)

Collapse
 
patricktingen profile image
Patrick Tingen • Edited

To each its own of course, but for the life of me I cannot imagine why I would want to turn off syntax highlighting. If it helps you being more productive and understand code better, then please continue, but it's not for me.

With highlighting, I can easier understand the structure of sentences in the source. Keywords stand out and I can quickly scan the code for the parts I am interested in. If I suspect something is wrong in the definitions I scroll up until the color of the code tells me I am in the definition part of the source. If I make a typo, the words don't color so it tells me I made an error so I would not want to live without it. To me syntax highlighting is the best thing since sliced bread.

Collapse
 
patricktingen profile image
Patrick Tingen

On second thought - and clicking through some of the linked posts - I must add that I am using a scheme with few colors:

Example

Collapse
 
gsonderby profile image
Gert Sønderby

Last time I didn't have any syntax highlighting while coding, it was C64 BASIC, and I was 10. I have generally seen my code improve and my errors be easier to find as the degree of syntax assist tooling I've used has increased. Today, I use (all hooked into Atom) prettier, eslint, and syntax highlighting (Nord theme)... Not a whole lot of syntax errors go undetected.

So to me, this would be catastrophic advice.

Collapse
 
kjocevicius profile image
Karolis Jocevičius • Edited

I think, with code highlighting, you really need to evaluate what is being highlighted. Then you will suddenly notice that it doesn't really make sense to highlight everything.

For example Java keywords highlighting is not necessary - you can live with having them bold. Highlighting every code symbol (function, variable) also kinda misses the point. However knowing which variables are static and which are constants - is actually useful.

I don't think a developer should code without highlighting - that's a bad idea. But you should evaluate what highlighting you really need.

Collapse
 
moopet profile image
Ben Sinclair

Your screenshot includes bold keywords and dimmed comments, so I assume you're either rolling your own or using a minimal syntax highlighting scheme, rather than actually turning it off?

You say "Getting more focus on the work, that mean, more productivity" but the only coloured thing on your screen, which immediately grabs attention, is a clock and a song title, both of which are totally unrelated to work (unless you're coding a bot that writes metal...)

Collapse
 
totiiimon profile image
Totiimon

I'm trying this out. Also trying out VIM since I delayed it quite some time!

I'm curious about your status line style and that music playing thingy. Would you mind sharing it? I love the style of it :)

Collapse
 
huytd profile image
Huy Tr.

It's just a script to display current playing song on Spotify on Tmux status line. You can take a look at github.com/jdxcode/tmux-spotify-info

For the tmux, I made a config file public here gist.github.com/huytd/10e490955d34...

Collapse
 
brainwipe profile image
Rob Lang

How can you say:

Getting more focus on the work, that mean, more productivity
Read/understand the code better, and even faster

Without a parallel you working on the same thing over that period of time? This is bogus click bait.

Collapse
 
cmilr profile image
Cary Miller

Haha, I can’t believe some of these responses... seriously people? I learned to code long before syntax highlighting was a thing, and honestly, while I do use it today, I like a very tame color scheme for the most part. To me it seems like everyone should basically create their own theme, because we all think differently, and we all react to colors and other distractions differently.

Anyway, here’s to experimentation and exploration!

Collapse
 
chainq profile image
Károly Balogh

I worked a long time on various (exotic) platforms without effective or any syntax highlighting. I think it certainly makes you a better developer, in the sense of reading the code without aids, and taking assumptions of the editor (or any tool) you're using as granted. I could compare it to watching the movie vs. reading the book. You have to put in more effort, but it feels you just somehow get to a deeper understanding of the code.

Also, strictly speaking, your screenshot is not syntax highlighting off, it's just limited syntax highlighting. In most my cases, not even comments or language keywords were colored differently. ;)

I think every developer should try coding with highlighting off, if for nothing else then for an adventure and to stretch their limits. And it's good practice to reduce your dependency on your tools, just as good practice to keep your code's dependency to the minimum, if it's possible with reasonable effort. Otherwise it's just a matter of taste. At this point I can certainly switch back to not using syntax highlighting at all with a few hours of adjustment. But SOME syntax highlighting, just makes me more productive, I learned. And when you have work to do, that matters a lot.

Collapse
 
millebi profile image
Bill Miller

Ha! I never noticed how little syntax highlighting I was actually using until I read this post and then quickly looked at my editor screen. Being colour blind means that I'm not seeing a lot of the "additional" information being added, so the end result is that I have 3 colours in use (base, constants, and strings) with bold for keywords.

I personally would think that too many colour variations would become distracting and slow down coding because you have to remember what each colour means rather than understanding the actual text of the code. But that's just me.

Do whatever makes you more productive. Working code is more useful than "pretty" non-working text :D

Collapse
 
markisundefined profile image
Mark • Edited

First of all, it's a personal preference.

Whatever makes you more productive the better. Personally though, I'd prefer syntax highlighting over the other because unlike you, it allows me to read, understand and browse the code much faster.

Your vim setup looks amazing by the way!

Collapse
 
huytd profile image
Huy Tr.

I agree. It's just the matter of personal taste, and I tend to share my taste to find more people just like me (or hopefully convert someone's taste :P)

Collapse
 
defman profile image
Sergey Kislyakov

I could try to disable syntax highlighting but I doubt it will boost my productivity. Better tools will do, so I count syntax highlighting as a tool. I have a delay (1s) before the linter runs so sometimes I detect syntax errors faster because of syntax highlighting. It's easier to me to navigate in colorized code as well for some reason.

Collapse
 
pinotattari profile image
Riccardo Bernardini • Edited

This is the color scheme I use. I am curious to try without colors, but I need to change all the entries in the preferences and right now I am lazy... Maybe I'll try.

Reflecting a bit, I think that the most important highlighting for me are the keywords and the comments. I could definitively do without highlighting for strings and numbers and maybe type names too.

Collapse
 
asgaardson profile image
Ragnar Sorensen

Wait what? While I can't wait for JetBrains to implement MORE distinct with MORE options to highlight something, some people DELIBERATELY turn off the highlighting in their editors? And try to convince others that indistinct gray text on black background is better than highlighted, bright highlight on dark background?

Not only syntax highlighting helps to understand code fast: you rely more on color than on reading code to see the place in code you're looking for.
If color scheme of syntax highlighting HURTS your productivity, you should change both editor and colorscheme, because it's the real reason it does not work for you.

Collapse
 
huytd profile image
Huy Tr.

When I first read about this idea, I felt it's so crazy, and same as most of the opinions here, I was rely on rainbow to check my syntax errors until I decided to give it a try.

It turned out typo and syntax errors is something you won't see if you really pay attention for every line of code you write.

And it's not completely syntax off, as many people pointed out, I used 3 different colors: gray, white and "less white" :D including the bold font.

P/S: I know it's hard to accept, just like if you forced yourself to have salad instead of baby back ribs for lunch, you missed the ribs but you feel good after finished the salad :joy:

Collapse
 
justgage profile image
Gage

Actually I've thought about this before. When I do it I realize that it encourages me to add more whitespace around things. I actually have a color scheme right now that highlights mostly comments which encourages me to write better docs. I think that most color schemes are just too dumb and aren't telling you much about your code. Really folks, just try it for a day or two as an exercise, see if your code comes out better.

Collapse
 
ethan profile image
Ethan Stewart

Syntax highlighting isn't to help me understand the code. I can read/write/understand the code I'm writing with or without the colors, but it certainly slows down my flow when they're gone. If having little or no highlighting works better for you and others then that's definitely what you should do, but there would be zero benefit for me to code like that all the time.

Collapse
 
felipezacani profile image
Felipe Zacani

Am I too late to mention syntax highlight is NOT off in your screenshot? I mean, it's grayscale, ok, but still.

I tried this a thousand times. I change my color schemes all the time, it's a little less boring, since we now have to code with plugins and linters telling us what to do.

Collapse
 
huytd profile image
Huy Tr.

Yeah I mentioned it: gray, white and "less white" :D :D :D

Collapse
 
nguyennb9 profile image
Finn

That kind of music will destroy your productivity anyway, j/k, I'm also a fan of Amon Amarth.
But I see the syntax highlighter will help me more productive, maybe it's everyone to his taste.

Collapse
 
perpetual_education profile image
perpetual . education

We teach with a plain text editor at first - to show what that's like. No one chooses to keep using it after we show them sublime. We find syntax highlighting to be very helpful.

Collapse
 
jorgecedi profile image
jorgecedi

You can change it in PuTTY going into Connection -> Data and changing Terminal-type string to xterm-256colors, xterm by default uses 8 colors. I use morhetz/gruvbox colorscheme in vim, it looks nice.

Collapse
 
csaratakij profile image
Chatchai Saratakij • Edited

Please share your syntax highlighting (so clean for me xD)

Collapse
 
huytd profile image
Huy Tr.

It's in the last URL of the post :D

Collapse
 
seanability profile image
Seanability

Used to never had it to begin with for the first 20ish years, but I would never turn it off now.