Why Good Syntax Highlighting is Important

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 ar…


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:

Good Example:
Good Syntax Highlighting Example

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:
JavaScript Highlighting

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:
Okay Syntax Highlighting 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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Why Good Syntax Highlighting is Important." Ashish Bailkeri | Sciencx - Sunday October 17, 2021, https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/
HARVARD
Ashish Bailkeri | Sciencx Sunday October 17, 2021 » Why Good Syntax Highlighting is Important., viewed ,<https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/>
VANCOUVER
Ashish Bailkeri | Sciencx - » Why Good Syntax Highlighting is Important. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/
CHICAGO
" » Why Good Syntax Highlighting is Important." Ashish Bailkeri | Sciencx - Accessed . https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/
IEEE
" » Why Good Syntax Highlighting is Important." Ashish Bailkeri | Sciencx [Online]. Available: https://www.scien.cx/2021/10/17/why-good-syntax-highlighting-is-important/. [Accessed: ]
rf:citation
» Why Good Syntax Highlighting is Important | Ashish Bailkeri | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.