The Most Unexpected Fun

21 Sep 2023

Introduction

When I first looked over ICS 314’s syllabus, it was not the HTML/CSS section that gave me the most concern at all. It was the Coding Standards section. Considering my previous experience with coding standards, I don’t blame myself for being apprehensive. Just last semester, I was forced to write code that aligned to the coding standards that Professor Ravi set in ICS 212. Except in that class, we coded in VIM. And used some variation of gcc/g++. In a UNIX server. Anyway, I hated that! For the first few weeks of the semester, I constantly got points taken off for what I thought were little errors that were impossible to find in the tiny little console window.

A New Hope

So, with a whole lot of whining, I began to look into ESlint, convinced that this was when the class was going to get annoying. However, as I began to write code in IDEA with ESlint installed, I began noticing that I actually really enjoyed having it around. When I initialized a certain value with let, it told me it was better to use const. With the click of a button, it fixed it for me. The experience of getting rid of those red lines was almost like getting the dopamine burst of finally completing a section of code correctly.

ESlint made me write the same code using half the lines, and also helped me create much more readable code. A lot of the changes it recommended were not only cosmetic, but helped the functionality of the code as well. I can tend to be a little long winded when writing certain operations, and ESLint would scold me if I did. It was like having an extremely bossy, but nice, teacher watching everything I typed.

A Learning Experience

Another major benefit I experienced when turning on ESLint was the way it taught me how to not make the same mistakes over again. Instead of getting satisfaction from getting rid of the lines, I got it from not ever having those lines at all. Previously, I was learning JavaScript with nothing to stop me from writing inefficient code, as long as my output was correct. In the long run, this probably would have hurt me. I would still probably be using let for everything instead of throwing in a const every once in a while.

In a lot of ways, having an automatic code style analysis tool completes me as a programmer. In both my code samples and life, I can tend to be a little free spirited. In the corporate world, this probably would not fly. Having a program that both encourages me to write “pretty” or “standard” code both teaches me how to do things the right way and keeps me on track when I slip up every so often. Even though the experience of enforcing standards in VIM was absolutely awful, I actually have a lot of fun getting everything tidy now.

Conclusion

While I still may not be the biggest fan of the concept of coding standards as a whole, I must say that using ESLint has been a really pleasant surprise. It is useful and relatively painless. While it may end up being annoying once I begin to create larger projects, I still think that having it on is much more of a help than a detriment. Eventually, I hope to be at the level of engineer that can use ESLint and never even notice that it’s on.