New Horizon of Coding Standards

09 Feb 2022

Before University

Before entering university to pursue my major in Computer Science, I was not too familiar with coding standards. I started programming in the second grade, but at that time, it was acceptable to just write code in a straight line all the way down. Soon, I started to learn that just having a code in a block (like a paragraph) with no indentations or spacing, made it nearly impossible to trace and find errors. However, I was not too familiar with what the correct standards were to make my code look cleaner and I was following my gut on what looked nice and where I thought I needed to put spaces, indentations, etc.

Significance of Standards

In ICS 111 and 211, we were introduced to the Eclipse IDE, and that was when I realized how bad and messed up my coding style was. For my first few assignments, I was busy trying to clean up all the red squiggles and I quickly learned what the correct amount of spacing and indentations were needed for different situations. By just fixing my coding standards, my code was easier to read and comprehend. I could trace my code and find errors more easily and quickly. I agree that one software engineering technique we should implement to improve quality is coding standards. Coding standards can definitely help you learn a new programming language and save you time from having to go back into your messy code to find errors. All programmers have their own way of writing code and a different work environment. Therefore, not everyone may fit into the standards that many suggest. However, I believe that ESLint is able to standardize everyone’s style of code, in one way or another. Whether you are a veteran, pro or a complete newbie to the programming world, ESLint can help you to solve problems. I always used to put the close-curly brace on the same line, rather than a new line, but I found that by putting it on a new line, I am able to track where I am and it acts as a placeholder for each section of my code. IntelliJ allows us to easily implement ESLint into our projects. By having the same coding environment, we can also help each other out since we are using the same set of tools and can point out things, someone may have missed.

Good Helper

Although I thought that my code looked bad, I have seen many that looked far worse than mine. As I got better with formatting my code, I started to help out a lot of my peers. However, it was hard to debug their codes because sometimes they would have three spaces instead of four, and it would be hard to catch these types of errors. Sometimes they would have all the curly braces overlapping each other, so I could not tell where their methods or functions began or ended. ESLint is able to catch all these detailed errors and I believe that it is a good helper to have anytime you are coding. Something as simple as a spelling error or a missing semicolon can cause long hours of frustration. Debugging tools/editors are able to catch these errors or provide insight on what may be causing your code to fail.

One disadvantage about coding standards is the person coding. Although I know that coding standards are helpful and can catch errors right away, I have a tendency to not fix it right away and just come back to the error once I finish. However, this takes up extra time and sometimes when fixing errors, you realize there are more errors, so even more time is wasted.

All in all, adhering to the code standard is highly beneficial. Coding standards can save us a lot of time and help us to work more efficiently. Seeing the green checkmark once we are done fixing everything is very satisfying and it gives me the feeling that, although some of my tests may fail due to other reasons, I am on the right track in completing the task.