This content originally appeared on DEV Community and was authored by Ashish Bailkeri
All code snippets posted are under the MIT License
So does it really matter?
Yes. There good programming practices in certain programming languages but there is also good developing practices and this is one of them.
So what are the advantages?
- Higher Productivity
- When programming with better syntax highlighting it becomes easier to identify where parts of your program is based on the color. With color schemes with limiting syntax highlighting on certain semantics, it can be really difficult to differentiate between what may be a parameter variable or a local variable, or in the case of C++, macros, enum values, global variables, etc.
- Encourages you to code
- What do I mean by this? I mean that you actually feel more engaged looking at a diverse array of colors on your screen rather than dull jumbled array of words that happen to put together a program.
Let me show you what I mean:
Snippet from Jet.
What does this do well? It has a vast amount of colors that is easy to differentiate parts of the program immediately, it is not just about I have highlighting, but it really tries and brings out different parts of the program. I can easily point out macros, class variables, parameters, and functions almost instantly through this highlighting.
There are benefits to this in dynamically-typed languages too,
let's have a look at JavaScript:
Of course, this also depends on your editor's capability but other popular editors like Visual Studio Code, still provide support for semantic highlighting. But we can see clearly how this highlighting improves the coder's experience and provides clarity.
Not so Great Example:
This theme is known as Dracula, JetBrains's default dark theme syntax highlighting, and while it does the job, makes me feel less excited to code. Important type values such as size_t
are not highlighted in this example and can easily be overlooked as they have a very similar color to the delimiter tokens.
Disadvantages of Good Syntax Highlight
- Get lost in the sea of colors that is your code
- No? That's just me? Well let's move on then.
Conclusion
My opinion is this: the making of a good programmer is one that knows how to use the tools available today to further increase their skills, and this includes something as subtle as syntax highlighting and font choice.
This content originally appeared on DEV Community and was authored by Ashish Bailkeri
Ashish Bailkeri | Sciencx (2021-10-17T18:30:11+00:00) Why Good Syntax Highlighting is Important. Retrieved from https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.