Patrick Crosby's Internet Presents

syntax off

25 Mar 2014

As an experiment, I turned off syntax highlighting a week ago. Now it seems weird to see it.

With syntax highlighting on, my eyes focus on the highlighted text: keywords, strings, numbers, built-in types and functions, and comments. The types I create aren't highlighted. My function names get no special treatment. Visually, you have to fight through the colors to get to your own code.

An argument for syntax highlighting would be that it helps you find errors while you are editing. The errors that it might make more clear, however, are basically typos. There are so many tools that continuously build, format, lint, and test your code that any of those errors can be caught immediately by tools that know the language.

Syntax highlighters often make mistakes. They are not language parsers. For example, string is a perfectly valid function name in Go. Yet it is highlighted differently than timestwo in this example:

Without syntax highlighting, I find code more readable. We don't read books or articles with different colored words, why is code different? But I could be weird: I still print out code on paper sometimes to really read it and analyze it.