Code Smarter, Not Harder

11 Feb 2021

ESLint Impressions

Before taking ICS314 and using Javascript, the only thing I experienced that is similar to ESLint was Checkstyle in ICS211. I remember typing out a Java class for homework, finishing it, and pressing somme combination of keys for Checkstyle to do its thing and format the code. I was stunned by its simplicity. I really did not have to do that much work. But I did not know how it worked. Compared to Checkstyle, ESLint has a not less hand-holding and explains why some things are not allowed. As mentioned in class, you can actually look up the error code for ESLint and learn why things the way they are, instead of simply accepting it as it is. If I remember correctly, Checkstyle would only highlight lines with errors with no explanation as to what was wrong. While Checkstyle was easier to get into, ESLint, so far, seems to be better in terms of learning how to format my code. Writing out code only to see 5X at the top right was a struggle at first. So far, actually learning how to get rid of these errors and slowly attaining the green checkmark at the top right has become one of the most satisfying moments in my programming career.

Advantages of Coding Standards

Learning how to keep your code neat goes a long way. One of the troubles of messy coding is the hardship of looking through your lines of code to find an error. Many minutes, hours, days even, can be saved by learning how to format your code. Not only does it improve readability, it also improves teachability. Say you want to explain to someone how your code works, whether it is a person who has never programmed before or your partner for a project. Would you rather try to explain a messy pile of garbage or neat, organized piles of garbage?

Clean Code Sells

I vaguely remember hearing Jason Leigh in ICS111 say that the number one reason why a person wants to become a programmer is not to make video games, or to create the most intelligent AI, but to make money. Although the former two are means of making money, money is the end goal. Piggybacking off of the improvement of teachability, say you want to present and propose your code to a board of people with enough money to fund your project. Explaining to these people that your code is important and worthy of their support is easier done with clean code instead of messy code. Clean code is a lot easier to sell than messy code.

Closing

Learning how to conform to coding standards will help more than not in the long run. Whether it is for school or for work, coding standards will make life easier.