Coding Standards

13 Feb 2025

What are Coding Standards

Most people associate coding standards with indentations, brackets, or in-line comments. However, they are much more than cosmetic guidelines, they are an essential aspect of coding that influences the overall quality of the code. Conforming to these standards ensures clarity from your peers, co-workers, or even your future self. This is especially relevant in large projects with multiple contributors. It is a crucial skill to master if you plan to truly exceed.

First Experience

In the past week, I had my first experience with utilizing ESLint in Visual Studio Code. The set-up process was a little confusing, it took me about an hour using three different tutorials to get everything to work correctly. The coding environment felt similar to ones I have used in the past. Initially, I found it tedious to have to manually download files into every new repo I made, but I am used to it now. I also found the html boilerplate extension to be very helpful, I could not imagine having to type all of that out whenever I start a new project. One of the main issues I faced was the live preview using the external browser. It felt like no matter what I tried, I could not get my code to output in the browser console. The issue turned out to be that my Typescript file was appearing empty, so no code was being passed to my Javascript file. I figured out I had to manually save-as my Typescript file, and then run the ‘npx tsc’ command. Aside from that it went pretty smoothly.

Tedious, but Useful

One of the first assignments we had was fixing errors in a pre-existing code. When I first opened up the file, I was surprised to see that such a small amount of code could contain that many errors. I went line by line correcting each error. I found it helpful that all of the errors were underlined in red. Additionally, hovering over an error created a pop-up window with an explanation and sometimes a solution. Even with tools, it did seem a little frustrating to have to correct every single error, especially when some are so simple. However, I feel like doing it will make me think more critically about the code I write. Overall, his experience was very informative and helpful, it allowed me to familiarize myself with the coding standards. As a result, subsequent assignments I have worked on have fewer and fewer errors when I first compile my code. I think it is fair to say that adhering to coding standards has helped improve my coding.

Conclusion

In conclusion, coding standards are indispensable. Some people may argue that they are tedious or act as unnecessary constraints, but they are an essential element of producing high quality code. They enhance collaboration, reduce bugs, and create a consistent coding style. Tools like ESLint may seem challenging to adapt to, but it is worth it in the long run.