Another Tool to add to the Toolkit.

20 Sep 2023

Just with like anything in life, there are guidelines that one can choose to follow for the best experience. With coding, these guidelines are there to ensure that not only are our codes readable to not only us, but also other people who might use parts of our code in their own projects. In addition, it lets us know of errors that may have not been easily spotted otherwise, saving hours of time in the debugging process. During my experience with Java, I also had to download a certain coding standard called CheckStyles that would make sure our code was appropriated spaced, there were no syntax and other errors. It allowed for more assurance as I didn’t need to go check those things myself.

The ESLint Experience

Now enrolled in ICS314, I have had to do the same procedure, of installing and using a coding standard for the class. This new standard is called ESLint, which at first glance was superior than CheckStyles in both usage and performance. It was able to check for more errors, such as using ‘const’ and ‘let’ instead of ‘var’, as well using single quotes for strings instead of double quotes. However, that may also be due to the fact that JavaScript and Java have different coding syntax and preferences.

After using ESLint for about a week, I can say that I’m fairly neutral for this new coding standard. On one hand it is extremely useful in reminding me of to use certain keywords and correcting me on my syntax errors, which I can fix all with a couple clicks of a button. On the other hand, the errors that pop up when you have an extra line at the start or end of your code has become excruciating, as a huge red squiggly just appears on my screen, and everyone knows how annoying those are when you’re coding. The red squiggly makes it seem like a big error has occurred in the code, and that if it’s not fixed, the code will not run properly, but it was just an extra line that was accidentally put there. I preferred it more when compiling errors were marked in red squiggly, and other minor errors were marked in a light yellow color in CheckStyles. Even after some scouring of the settings inside IntelliJ, I still wasn’t able to get two different types of error squigglies to show up for different types of errors.

Consistency

One thing that coding standards do really well is being consistent. As long as you follow the guidelines for all of your files and projects, you’ll be able to look for code, understand the code, and be able to use the code extremely efficiently. This applies to not only your own projects, but also to projects where you are collaborating on with someone else. Since both of you are using the same coding standard, there should be very little confusion on the code being written.

Consistency is something that I think is the biggest benefit of using a coding standard like ESLint, it creates an environment where everyone can be on the same page, to be able to understand the code, and utilize it for what it is intended for.