“When you’re looking at a cup, which part do you think should be the cleanest?” is a question that my TA Branden recently shared with us related to coding standards. “No matter how great the physical aspects of a cup may be, it’s more important when it’s clean enough to drink.” He compares this idea with web applications – that no matter how impressive and pretty a website might look like, it’s rendered useless when it doesn’t work the way it’s supposed to. As a programmer, it’s always a best practice to have a clean program in order to minimize the amount of errors that may arise in the future.
ESLint is a static code analysis tool that detects error patterns in a JavaScript code. I recently got to experience using ESLint in my Software Engineering class and I thought it was really helpful in keeping my code clean. It quickly detects any error patterns that I have typed in my code, and further tells me what the error is about. The utilization of this tool has made me realize how messy my code can be. ESLint is so meticulous about the number of spacing, the number of lines, and even the type of keywords used. A constant increase in the number of errors makes me agitated whenever I build my code. But seeing the errors is also reassuring in a way that confirms that ESLint is indeed working. ESLint reminds me so much of what a mother is. They always keep you on your toes, making sure that you are not doing any bad things. They only want you to do the right proper things. And essentially, such discipline will help you grow as an adult. Just like ESLint
I’ve come to realize that seeing a green checkmark has become much more rewarding with ESLint. A green checkmark signifies that you’ve met all the satisfied requirements that ESLint expects – that the code is clean. The additional expectations that ESLint has has put much more value and appreciation into the work that I’ve put into, because not only it confirms that it runs, but it also confirms that the code is clean.
“Slowly is the fastest way to get where you want to be.” -Betty Goedhart
I believe that building this habit during the early stages of my programming career can essentially be helpful in the long run. It’s best to build a good coding standards now, rather than trying to fix bad habits later on in the future. As tedious as it can be to download the ESLint file in every project, and having to run npm install each time, it will save me so much time in the long run. It’s an investment to my future self.