The Right Way to Code?

21 Sep 2022

I haven’t followed coding standards

During my entire time in school none of my classes had me follow any coding standards. The premise was if the code worked then it was good enough. While it was nice to not follow any strict guidelines, I realized a few bad habits. While I was working with code, I ended up being messy, having multiple empty spaces, random variables, etc. The code was a nightmare to look back at. Sometimes I would have to pick it up later and forget what I was doing. Naming variables a, b, c or test1 doesn’t help either.

Good practice or useful?

Obviously you don’t need something telling you how to format your code. Coding is all about personal freedom and the way you like to code probably is different from how someone else codes. Though in the field I think it is extremely important to follow general ideas so that others can read and build off your code. I find the coding standards to be helpful in creating that habit. Another benefit is also debugging code. For example, what if you have a variable that you forget to use or forget a bracket. You are able to catch it before compiling which is pretty handy. Not to mention may reduce the amount of code you write.

A minor inconvenience

I find that it really isn’t hard to follow the coding standards. I end up just accepting the suggestions ESLint has given me. Though the constant red lines and stuff may be an annoyance to some. To be fair I would rather deal with a piece of software correcting me then having someone look at my nightmare code. So overall I am glad we use coding standards because it is a relatively nice change.