Standard on Coding Standards

21 Sep 2023

Coding without Standards: “wOuLd yoU RaThEr reaDThIs TeXt ; Or read this neatly formatted text?”

Imagine you are reading an English paragraph, one that is without proper syntax, grammar, capitalization, or any sense of standards in the way it is suppose to be written. How horrific it would be to attempt to process and decipher that information. It would be chaotic; cryptographic in its worse case. Such is the reason and foundation as to why any sort of standards exist: to provide a sense of organization and clarity in the intended message. In consideration for coding standards, it is in place so that programmers can readily identify and process pieces of code and its intended usage. If there were no coding standards in the first place, rather than making progress on a project, unnecessary time would have to be spent trying to understand what the code even is.

Benefits of Coding Standards

There are a number of benefits to making coding standards: it makes your code more readable, not just to you, but to anyone else who might want to read it. Even if they were not the ones who wrote the code, because of the coding standards in place, they know what to expect and know what format the codes should be in, thus if they are any decent of a programmer, they will be able to understand your code. Coding standards also enable effective communication and promote collaboration, where programmers can code efficiently because they do not need to think about what kind of code they need to write: they have a convention which they abide by. The convention establishes the norm of coding, and brings a sense of familiarity to the code they write. Just like how a compass provides you with a heading to move toward; coding standards establishes guidelines and points programmers toward the programs they want to develop.

The ESLint Coding Standards

Throughout my time so far coding with the ESLint coding standard, it has been a blessing to code with it. I feel that my coding process is more concise and less erroneous as the coding standards sets me up with standards to abide by, that through repetition, results in more effective and efficient coding. A feature I particularly like is the ‘:type’ that results in the coding process. It allows me to clearly see what the type of my return values and/or variables/functions are, just with a single glance. It helps in formulating the logic of my code, where I can effectively evaluate whether I am using the expression in my functions.

Another feature, that has me on the fence, is the green check mark. Initially, I was annoyed by how much reformatting of my code the coding standard does concurrent to the coding; however, I later found out through hovering over the green check mark, there are options to change what coding standards are being looked for, whether it is none at all, just the syntax, or all the problems found. Personally, I found it useful, during the initial coding process, to turn the settings to ‘syntax’ only, as it reformat your code less as you code. I would then turn on ‘all problems’ at the end to ensure my entire file is in standards with ESLint.

Conclusion: To code without standards is to not meet any standards for your code.

Coding standards result in benefits such as effective and efficient communication and collaboration, readability of code, and establishing expectations for coding. Coding with the use of coding standards should be a standard in it self. It creates structure and organization in the way programmers code and proceed with an action. While in my experience I have only been introduced to the ESLint coding standard, I am curious as to what other coding standards exist out there, and what difference and benefits they would bring.