Coding-Standards?

09 Feb 2023

Coding Standards?

What is a coding standard? Before entering this class, I’ve heard of the idea before, but never really thought about it. “Of course we have rules!”, I thought, but when truly thinking about it, I’ve been following the rules without giving them a thought. Coding standards, like any standards, are rules that “improve” your code. By improve, I mean its easier to read. Say for example you code something without these rules. You may leave that code aside, completely forgetting about, till one day you remember that you could utilize it. You open the file with horror, not knowing what in the world you are looking at. At this point, it mine as well be egyptian hieroglyphs, so you decide to scrap it and just make it again, wasting the precious time that we already have so little of. The problem gets even worse, if you, the person that made it, can’t even tell what it is, would you expect, say a teammate or some complete stranger to understand it? That’s where the true power of coding standards come from, its more than just a way for a computer to yell at you because you had an extra space in your indent.

Benefits I’ve Seen

In ICS 314, we use ESLint together with Intellij. Compared to previous IDE’s I’ve used, so far I think Intellij is probably the best one I’ve used. I love the ease of use with this IDE and it is very clean, similar to Eclipse, but I feel more gravitated to this new one, maybe recency bias. In combination with ESLint, I find that the IDE actually points out breaches in code standards is very helpful. Having a tool that tells me the problem and gives a suggestion to solve that issue, gives me reassurance that I’m coding correctly and I can avoid most problems. Assuming coding standards are similar to coding style, I can see why people can hate it. For example, in ICS 212, while an excellent class, we had to code with Vi, which is the most bare bones way I have ever coded, and it was terrible because I also had to follow a coding style. Indentation requirements and a bunch of other rules, I can see why someone might hate them. I would have to comb through my programs just to double check whether or not my indentations were four white spaces, which now experiences ESLint, would have been a awesome at the time. Experiencing both sides of the coin has made me appreciate the standards, but having tools that remind me of them.