I recently started using IntelliJ to code in Javascript, creating Github repositories and connecting them online. As these tasks were all quite new to me, it took some time to get it all figured out. Of all the different things I did, the most interesting was when I started using ESLint, a code quality and style checker. When using it, it not only checked for the integrity of the code, but also the format and spacing of the code using a green checkmark to indicate the code was all good.
ESLint was quite different to the previous code checker I used in Eclipse, granted it was just a checkstyle. As my only previous experience was with checkstyle, a code checker which only checks for code integrity, I found myself surprised at the amount of errors in such simple code. For example, a “Hello World” had to be changed to ‘Hello World’, from double quotes to single quotes! I soon learned about all the different errors, such as incorrect spacing and braces, something I never truly thought about previously. While I kept my code clean, it was not to this crazy amount of detail.
Using ESLint was both rewarding and frustrating due to that green checkmark. To test my code, I would need to get that green checkmark, which made testing the actual code harder. To test if the program worked, I would need to go through my code and make sure each line was written with the correct code style or else it wouldn’t pass ESLint. While this may help some learn coding standards and get used to it, as I already have a code style I am familiar with, this felt like something I didn’t really need to do.
I do think having good coding standards is extremely important, despite my negative comment about ESLint. It is important not only when you are sharing code and collaborating with others, but also just for yourself. If you can’t read your code quickly and constantly take time to figure out what you have written, it makes the whole process of writing code inefficient. Writing code with a code style checker is both very helpful and sometimes frustrating but overall, it’s very useful!