Are Coding Standards Necessary?

07 Feb 2024

A trivial standpoint

Coding standards are a double-edged sword. To some, they offer a sense of conformity for better readability and consistency across different programs. For others, these guidelines seem like a thorn on their side. For me, using ESLint on IntelliJ did not pose too much of an issue. I thought that the system simple to follow since it checks the current style of the code I had written and indicates what errors I made, regardless of it being major or minor. At first, it did seem a little unpleasant as it would point out tiny details that did not affect the code’s functionality. As I gained more experience with it, I found that coding standards have actually given me a more nuanced perspective regarding its significance in both a personal and professional setting.

Linting the mess!

Writing code and immediately seeing red underlines and yellow warnings was annoying as it quickly piled up before finishing a line. Warnings and errors about having no empty lines at the beginning or end of the file and spaces between parentheses or semicolons were hassling. Acquiring the green check mark takes time, but seeing it appear gives a sense of relief and satisfaction as the errors clear up out of the editor. Although it is initially painful, getting the hang of the format and style becomes easier as the warnings are helpful in quickly identifying the errors. Others even have a speedy fix for them being available by hovering over the red marks.

A double-edged sword

As mentioned, coding standards may be a thorn in our sides, but they are ultimately beneficial. It is especially more so with regard to helping a programmer format and improve readability. For example, following uniformity and having consistency across multiple projects makes it easier for others to understand another person’s work in cases of debugging or fixing other parts of the code.

On a side note: following these standards does not necessarily mean that a person adhering to a styling system will help them learn how a programming language works, especially if they are just starting to learn how to code.

In a professional environment, sticking to coding standards is important. Working in teams and developing large projects needs a sense of uniformity and consistency among the group members. In turn, this makes it easier to collaborate when updating or maintaining code. Being more accustomed to the standards has made me more mindful of how I write and format code. Though the strictness of coding style is viewed as a trivial aspect, it should play a factor in how we write code, since it is a valuable tool for ensuring readability and quality in future projects.