More Than a Standard

11 Feb 2020

My Experience with ESLint

I recently had my first interactive experience with coding standards in my software engineering class. My class required that we use ESLint to check our coding style and quality. It was a little troublesome at first because I usually use double quotes when I write my strings, but ESLint requires single quotes. It was a small inconvenience, but now I’ve become used to using single quotes. I actually find it easier and it makes the code look cleaner because it looks less cluttered. Another inconvenience I noticed about ESLint is that once I make a function it will pop up with red squiggly lines everywhere because I haven’t used the function yet. I find this feature extremely useful when it comes to detecting variables I am not using. However, when I am creating functions I don’t immediately write the line of code that I use the function in, so the red squiggly lines make me feel rushed. Although, overall ESLint has proved to be helpful in keeping my code neat and understandable.

The Applications

After spending some time getting used to the coding standards, I started to realize the true usefulness of having software engineers follow these coding standards. When we follow a set of guidelines for coding, our code becomes cleaner. Clean code is easier to debug because the code does not look like a jumbled mess with random spacing and unused variables. Following the coding standards also helps other software engineers because having clean, well-formatted code makes it easier to understand what each function and line of code does. It helps with putting the pieces together and figuring out the overall purpose of the code. When other software engineers can understand the code, they can help the coder improve the code and debug it as well. I understand that it can be a hassle to follow a certain coding style because code is supposed to be a medium for expressing one’s creativity and ideas. Rather than thinking about coding standards as restrictions, it’s better to describe them as guideposts. These standards do not restrict the capabilities of the code, instead they provide a cleaner and more efficient way to use the coding space.

A Comparison

Following the coding standards:

function tester() {
  console.log('Hello world!');
}

Not following the coding standards:

function tester(){console.log('Hello world!');}

Although both of these statements work and accomplish the same thing, when these functions are combined with code that has over hundreds lines of code it’s much easier to understand the code that follows the coding standards with consistent, clean spacing.

A Final Note

All software engineers should give coding standards a shot whether it be their class’s or work’s standards because in the long run it proves to save time and effort.