The Standards We Hold Ourselves To

22 Sep 2021

The most basic formatting that almost every programmer learns is the indentation. In fact, newer programmers who start with languages like Python are forced to learn proper indentation. However, many other languages like Javascript and C do not enforce any type of styling, and will even allow you to write an entire program on a single line if your heart desired. However, without some degree of formatting, even the simplest programs become difficult and tedious to trace. It is for this reason that coding standards should be implemented and enforced.

By implementing a standard that will throw errors at incorrect formatting just like errors thrown for syntax issues or program bugs, programmers can be “trained” into making their programs organized and readable. Of course, there will always be those who leave their code sloppy, but they are only hurting themselves and those they work with. By making sure that code is readable and standardized, bugs are easier to find, and it is much easier to look at another’s code and assist with troubleshooting.

Personally, as someone who has taught beginners how to code, improper formatting is one of the biggest sources of errors for them - after excluding errors that come from a lack of understanding of course. I have seen many programs fall to a line that was placed incorrectly due to an improperly indented bracket, or to a variable that was given an improper type and scope. A coding standard prevents these issues by telling you that a line needs to have another indent, or that your string should actually be declared as a char. By giving this the tool of a coding standard to a beginner, hours of confusion can be shortened to an error and a simple correction.