Have you ever looked over a colleague’s or a peer’s code and been completely disoriented because their work was not organized like yours? Maybe they didn’t use enough spaces between sections of their code and you can’t read it easily. Or possibly they didn’t indent their lines of code correctly and you can’t identify where their functions or statements end. This is why having and following coding standards is important. They specifically help with:
So when you look over someone else’s code or even your own, you feel confident in what you’re reading.
Before I was introduced to software engineering I did not consistently apply coding standards to all my class projects. One could say that I only followed certain coding guidelines if I knew my grade depended on it. Otherwise, my main concern was not what my work looked like, but if it was correct. This is most apparent in my astronomy courses. Since most of the code we write is private (not meant to be shared), the appearance of our programs does not matter as much as its validity. However, in my research work (which is available to the public) making my code organized and efficient is critical. Therefore, even though following coding standards is not my top priority sometimes, I do appreciate consistency, correctness, and readability.
In the software engineering course I am taking (ICS 314) we are using ESLint with the IntelliJ IDE to implement syntactic coding standards in our projects. So far, I am very appreciative of the services this tool provides. Specifically, the tool identifies syntax or structural problems that would otherwise disable my code from working. This enables me to code more efficiently and in less time because I don’t have to try to locate syntax mistakes in my code. In other words, ESLint eliminates all the syntactic errors so I can focus on semantic ones.
However, sometimes I feel as if ESLint does too much. Often when I write code I am not focused on its appearance, but ESLint is. For example, the tool will catch small things like if I missed a space after a curly bracket (“{“). This problem does not impact the correctness of my code, but it may make it more readable to someone else. As a young programmer, I tend to make syntactic errors like this quite often, so I tend to spend some time fixing small typos. For example, when I am working on an assignment in IntelliJ sometimes I can spend half of the time fixing seemingly unimportant mistakes.
Overall, I welcome the use of coding standards in programming, despite how exact and tedious they may be. I think it is essential to be able to write readable, consistent, and efficient code to be a successful programmer. I also believe that following coding standards, specifically those ESLint imposes, will help me learn the JavaScript language better. Like when you’re using any word processing feature to check the grammar or spelling of your writing, after a while you will start to remember the suggestions it gives you. Eventually, you won’t make the same mistakes and therefore will have learned something about the rules that govern the language. This is exactly what I have found to be true with using ESLint. It just takes practice and patience!