Red Squiggly Lines

10 Feb 2021

What Are Coding Standards?

Unless you are some sort of advanced supercomputer, then you most likely have written incorrect code. And what I mean by “incorrect” is not that the output is necessarily incorrect but that you failed to abide by coding standards and the IDE you were using started threatening you with those relentless red lines under your code. As programmers, we sometimes pull our hair out when correcting all of our code and trying to please whoever is giving us these errors. Unfortunately, there is no one to blame but ourselves because the IDE, or more specifically the lint tool, is simply binded by the code style of the language you are programming in and therefore must enforce coding standards. Some programmers like myself haven’t even heard of coding standards but do what the lint tool says anyway. Luckily, coding standards were created for programmers to give a uniform appearance to code written by different people and ensure code quality. They are enforced to detect and remove basic coding mistakes that are associated with the language or library you are using.

Why Should We Care?

So why should we care about how our code looks? What matters is that it works, right? On the contrary, applying coding standards is just as important for you as it is for other programmers or engineers. When working on a project with mulitple collaborators, it is crucial that the code being worked on is readable and neat so that others can understand what it does and help to correct it if needed. Otherwise, you and your colleagues might end up spending more time and effort deciphering messy code than making progress on your project. In addition to readability and maintainability, having coding standards allows one to reuse code which can optimize the workflow of a large-scale project tremendously. Finally, implementing and enforcing coding standards promotes exemplary programming habits and increases one’s own efficiency as a programmer. We have all heard the term “practice makes perfect” and it is no different for programming and coding standards. The more you practice good programming habits, the better and more efficient you become.

My Experience with Coding Standards

As a computer science student, I have done a fair amount of programming and thus I have some experience with coding standards but I have not truly known about it until recently. Like I previously mentioned, I did not know what coding standards were and mostly did what the lint tool told me to do whenever I had a style error in my code. And by putting a name and a definition to it, I am more aware of its importance in quality programming. I have begun to use ESLint with IntelliJ IDEA to learn Javascript and software engineering and I find it very useful and helpful when writing code. In addition, I have also started to learn the different key bindings in IntelliJ IDEA. Coupling the two, I can simply correct any code that violates a coding standard with a simple keystroke. Futhermore, IntelliJ IDEA displays a symbol in the top right corner of the IDE indicating there is a coding standard violation and how many there are within the code as well as a green checkmark that doubly serves as an indicator of an abscence of coding standard violations and my competency as a programmer. However, it can be more annoying than it is useful when creating small programs where I am merely testing out an algorithm. Nonetheless, I imagine that as I take on bigger projects in my future career, implementing and enforcing quality coding standards will make my work much more efficient.