Standards and Lint Rollers

08 Feb 2018

Having taken a good number of programming courses in college, one thing all these courses had in common was that each professor had their own coding standard. New class? New coding standard to learn and abide to for the semester. One semester I have 4 spaces in my tabs and indents, then the next semester I have 2 spaces in them. Maybe in another semester I’m in two classes with differing ideas on where the close-curly-brace goes, and that you should absolutely include braces where optional. However, moving past personal preferences, what most of these standards had in common was programming common sense.

While, in my opinion, tedious at first, coding standards have been very helpful for me. As a student, it has helped me understand languages better by getting to know what is expected from my code. For me, it feels like coding standards have made learning the syntax of a new language a lot easier than just churning out lines of code without a care in the world. Another thing coding standards have made easier is the act of going back to my own code. One thing I dreaded initially was revising my own code. It was usually inconsistent and generally a mess, it’s hard to find out what’s wrong with anything in it when whole chunks look wrong to begin with. With the enforcement of these standards, however, revising and maintaining code has been a lot simpler. Mistakes stand out like a sore thumb more often than not. Not only is reading my own code easier, but other people’s too. When people typically have different ideas on how code should be written, reading each other’s’ code can be a nuisance. Coding standards help alleviate this difficulty. Like grammar in English, coding standards help us express ourselves in ways other people can understand, and vice versa.

Coding standards is an ideal I believe is nice to uphold, but going through code line by line to make sure it abides to each standard is tedious enough as it is, thus why automating the process has made my life easier. I’ve been using ESLint through intelliJ Idea, and being able to have my programming errors, bugs, and stylistic errors pointed out to me while I’m working has made the programming process go by a lot faster. While it can be a bit irritating to have to fix lines to get ESLint to show me it’s seal of approval, a green checkmark, it’s a lot better than waiting to run the code to find issues with my code. Stylistically, it just makes my code easier to read and fix in the moment; it’s nice to have code come out the way coding standard wants it to to begin with without having to review it line by line on my own. Being able to fix small issues as they pop up has been very helpful and time-saving, as it feels like the issues I waste the most time on are little mistakes in syntax. ESLint has also helped me work with the code standards in mind, so as not to get a red cross of disapproval. Getting the green checkmark is also a little bit satisfying to get, it makes coding a bit more enjoyable. Being able to code consistently according to the standards has made reading my own code less tedious as well. Automation of code standards has been a nice thing to have. Even if getting IntelliJ Idea set up took some time and effort, it’s definitely worth it for the convenience it provides.