The Correct Way to Code

09 Feb 2023

Why use it?

Rules and regulations. It might seem boring and tedious but no one can deny its importance. After all, if it wasn’t important, then why would people spend time making it? I understand that some treat coding standards as more like an obstacle than a tool. Afterall, they would think, if my code works in the end, why worry about how good it looks? But to me, that is a narrow way of thinking. For one reason, it would be a good habit to keep your code neat. If in the future there is a need to edit a code that you wrote a long time ago, you would need to quickly understand what you wrote in the past and if your code is messy, then it would take more time for you to understand it. Another reason is that if your job is coding, then you are most likely not working on it alone. You would be a detriment to the team if the rest of your team can’t understand what you wrote. If a company heavily relies on coding, then there is a high likelihood that they make their employees use an existing coding standard or they make their own as the first priority. Aterall, imagine how difficult it would be if everyone in that company code differently. The new employees that have to edit past code would have trouble understanding the code. This is the reason why coding standards exist.

A better programmer

Learning the coding standard is also a good way to improve your understanding of that language. Not only is it a good practice to learn but it also helps you get a feel of the language. For example, if you violated a coding convention, and you don’t understand why it is bad even if it works, you could go to the coding convention website to understand why it isn’t a good practice writing code that way.

My experiences

This isn’t my first time experiencing coding standards. Before using ESLint, I used Javadoc in my Java programming class. For me personally, I find coding standards to be very useful. It helps keep my code neat and consistent although it is a pain at times. It is also useful when fixing bugs in my code, for example, sometimes forgetting a semicolon at the end of every command or misspelling a variable after I declare it. Eventually, the more I used coding standards, the more it became a habit for me. Over time, it became less painful as I became more used to coding with it.