3 ms·
Syntax highlighting can not only colorize program tokens, but it can flag syntax errors. The first character of bad syntax is shown in some loud color, like bla
by kazinator 4y ago
Syntax highlighting can not only colorize program tokens, but it can flag syntax errors. The first character of bad syntax is shown in some loud color, like black text on red background.
Would you say that this is also of no help, and prefer to turn it off?
This prevents you from doing a round trip through the compiler for many an error.
(Or, in some systems, it actually doesn't; the compiler may be involved in determining syntax highlighting and pinpointing the first error, but it's done in real time under the hood as you type. You're not running a build and finding about the error in a log message.)
- gregjor 4y agoI would say that syntax highlighting, including flagging syntax errors in real time, is not useful enough to me to incur the overhead of linting the code in real-time, these days often requiring a language server. I have my editor set to lint the code on save. Other programmers may find real-time syntax checking useful. Showing possible syntax errors in the code during editing doesn't require full syntax coloring. I understand that syntax coloring can also show syntax errors, but the two features are independent, and you can flag errors without turning the editor window into a kaleidoscope.