I Hate Coding Standards

21 Sep 2016

I don’t really like coding standards. In fact, I hate most of them. Some coding standards seem so trivial; add a space here, a new line there, semicolon, semicolon everywhere. These little details always irk me. It’s not as if someone could not legibly read someone else’s code because he neglected to put a space between the variable and the “=” assignment operator. If we’re talking about these miniscule, manini changes in code that don’t change anything about what the code actually does, I would much rather do without coding standards.

My experiences with ESLint, however, have softened my stance on coding standards. Surely, there are a few irritating technicalities such as adding a space after every bracket, or having the file end with a newline. Rest assured, I still hate that part of ESLint. Sometimes though, I learn a little more about Javascript. For example, I just learned recently that the const variable descriptor is useful for variables that are never reassigned. This is infinitely more helpful that fixing whitespace. Why? Because this actually affects the properties of the variable. If I don’t want the variable to be reassigned later, I should set it to constant. If another collaborator attempts to assign the variable to another value, he will get an error. It fixes small mistakes like these. In large oodles of code, small mistakes can add up.

Overall, IntelliJ and ESLint have made coding standards more bearable. Although coding standards are still annoying, IntelliJ clearly states what problems your code has, and how to fix it. Some useful standards also deepen my understanding of Javascript. I’ll take the good with the bad, and continue to use these standards when possible (and especially when mandatory, as is for this class).