
What is your opinion on syntax-coloring of code? - vram22
Here is an example:<p>http:&#x2F;&#x2F;crystal-lang.org&#x2F;<p>Not for or against Crystal, was just most handy URL.
======
davismwfl
Syntax highlighting is good overall, the best is having some sane defaults and
the IDE/environment allowing the user to make tweaks to it. I personally don't
like dark schemes and prefer the white backgrounds now.

I never thought of the color blind side of it till I read Finnucane's point,
but the ability to tweak the colors mostly would solve that I guess.

I also really like that most editors are starting to highlight local, global,
class members/parameters/variables all subtly different. It makes identifying
them even easier. However, having that type of highlighting doesn't remove the
need for good naming (and coding) standards to make it easy to distinguish
proper scope etc.

~~~
bbody
It would be interesting if style guides were also integrated, e.g. you have a
non-standard variable name it highlights the background in a striking colour,
or the Word style red squiggly underline.

~~~
davismwfl
Yea, that would be nice. Basically a style checker that integrated into the
syntax highlighting in some way.

------
partisan
As opposed to not coloring it? I am for syntax highlighting. Those particular
colors you see on the site are a little bit harsh, but maybe because of the
bold/font weight.

I use the default dark color scheme on Visual Studio and while the colors are
a little muted, they feel easier on the eyes.

~~~
vram22
Yes, I meant as opposed to not coloring it at all, i.e. all the code is of one
(foreground) color. Sorry if I did not make it clear enough earlier.

------
Finnucane
I have red-green color blindness, so it's a problem. Dark red on black is bad,
green with yellow or brown is bad, shades of blue and purple can be hard to
distinguish. Yellow on black good, bright red on light background good.

~~~
bbody
Do many of them have the option to change the colours?

~~~
Finnucane
Yeah, it seems like most editors now it's not that hard to customize the
settings--so I end up futzing around with the colors every now and then to see
if I can come up with something better. It remains a not very satisfactorily
solved problem.

------
bbody
I am not quite sure which part of it you are asking about. However in general
I find syntax highlighting useful, helps quickly get the gist of code. I am
indifferent on colors, as long as they are consistent.

~~~
vram22
I was asking about the idea of its usefulness in general.

------
bediger4000
I turn it off and on. Sometimes, syntax coloring can be of benefit, like
mismatched single- and double-quotes un-terminated strings. Other times, the
colors make things less clear, and I turn it off. Vim's C syntax coloring is
an example of the latter.

As a side note, if you're looking at PHP malware, which is almost always in a
single long, long line, syntax coloring can be quite time consuming.

~~~
vram22
>Vim's C syntax coloring is an example of the latter.

Yes. On Vim I do:

:syntax off

Find all the different colors too jarring.

------
atsaloli
I prefer syntax-coloring -- makes it easier to catch errors quickly, as the
colors go all wonky if I miss a parens or a double quote, etc. This way I can
catch the error right in the editor, before it ever hits the parser.

------
vram22
I realized that I did not make the question clear enough. I meant : "Do you
prefer or not prefer syntax-coloring (vs. monochromatic B/W or W/B)?"

------
vram22
Thanks to all those who comment.

