Coding Standards: Cumbersome for the Writer, Easy for the Reader

08 Feb 2024

Why do coding standards exist?

Coding can be a confusing ordeal because it is essentially a language completely separate from the reader or writer’s native tongue. No one grows up with coding as a first language– not yet at least. Like in any language, there is a structure to writing which helps one make sense of the words being read. For example, in English each sentence starts with a subject, is followed by a verb, and ends with an object. Therefore, in order to establish a consistent structure that makes coding universally understandable, coding standards must be practiced and enforced. This ensures that anyone who knows the coding standards of the language you are writing in will be able to understand the structure of the code and quickly determine its function. This concept becomes increasingly important when code needs to be debugged because if there are commas, curly braces, brackets, etc. scattered in an inconsistent manner, figuring out where things are going wrong becomes frustrating and difficult. In conclusion, a well defined and universal coding standard may create more work for the writer because they must learn to follow the rules, but it saves countless hours in productivity because a person who has never seen the code before can instantly understand what is going on.

My thoughts on ESLint

I am thoroughly enjoying having ESLint to check my code and ensure that I am following the coding standards we are adhering to for ICS 314. This tool has been very helpful in reducing the time needed to read through and check my code against the coding standards because ESLint does it for me automatically. It has allowed me to even learn the coding standards as I go because I see the changes that it makes and know how to prevent errors the next time I write some code. Although the tool is a bit annoying sometimes because it gives me errors which are obvious at the time, like not calling a function or using a variable, overall it is handy and very simple to use. It has actually become pretty satisfying to see the red X go away and become replaced with the green check mark.