The Appeal of Coding Standards

18 Sep 2023

About coding style…

Coding style is something that often seems unimportant in comparison to actual code being able to run or perform at a certain time constraint. However, in reality, the benefits of sticking with a consistent coding style, in the long run, heavily outweigh the slight negatives of having to be a bit more meticulous and careful when typing out actual code. The consistency and thoroughness of one’s coding style can help drastically when debugging your own code but more importantly when your code needs to be looked at and understood by others.

My experience with a strict coding style…

ICS212 introduced me to very strict coding standards pretty early into my computer science journey. The professor for the class, Ravi Narayan, focused greatly not only on enforcing a strict set of plainly defined rules for how we format our code, but also really emphasized why he does this and why it is something we, as future programmers, should adhere to in the future. He referenced the many jobs he had in computer science and on the teamwork that was needed for those jobs. Being able to get across what you want your code to do and then what it actually is doing is the most important part about your code. If not for coworkers, then for supervisors sake, when they need to look over your work, having a clear and clean coding style makes readability significantly easier.

In ICS212, also because we had to code through the terminal, homework and projects took a longer than normal time because of the coding style standards we had to follow. Oftentimes an extra hour or so would be used solely for putting out code through the coding style tester and checking and correcting all of our mistakes. Despite this, I must admit that the end product was nice to look at! And while that might not seem like a big deal, being able to easily read through and follow code without having to stop for spacing or line break checks makes readability better and debugging a little less time consuming and stressful.

After a week of ESLint…

I have found that the ESLint coding style standards are actually really helpful when coding. I think that a lot of the time it is easy to just type and type and type without stopping to think about what you’re actually coding and ESLint checks help to kind of slow down the pace and make sure we are on track. I especially like the errors that help me consolidate my code, like being able to return a function in a single line, or telling me when I can change a variable from ‘let’ to ‘const’. The spacing checks can be a little annoying at times but it adds to the format being pleasing and easy to read in the end product so I also count that as a plus.

As for the green check mark, I find that it actually is a nice little reward before I get to actually run ‘finished’ code. It’s something to work towards, like a mini goal, that makes coding a little more fun for me!