Schrodinger's Coding Standards - A Reflection

26 Sep 2019

Schrodinger’s Cat

What do you mean “Schrodinger’s Coding Standards?”

To understand where this reflection is going, I must first describe the analogy to Schrodinger’s cat. This concept is probably one of the only things I remember from my modern physics course. Basically, Schrodinger had a cat, and he conducted a thought experiment on it (not an actual experiment). In this thought experiment, he enclosed a cat in a box along with a radioactive atom that could kill the cat. He then came up with the idea that as long as he did not open the box to observe the cat, then the cat would be both alive and dead simultaneously.

So…

This idea of being in two opposite states at the same time can be applied to the coding standards that I follow when programming in Javascript. Written code to coding standards is like Schrodinger’s cat to Schrodinger. It does not matter if I write quality Javascript code, if the code does not follow or observe a coding standard, then it is both good and bad at the same time. I want to avoid bad code, so following a coding standard is the best thing I can do to achieve this.

To do so, I needed a program that supports the Javascript language. I use IntelliJ Idea as my go-to integrated development environment (referred to as IDE). This piece of software seems fine by me, as it is the only IDE that I will need for my current purposes. I have access to other IDEs, but IntelliJ probably does what the other IDEs do, and I have limited experience in those IDEs. Second, I needed a standard to follow. There is software that I could use on IntelliJ called ESLint. ESLint configured IntelliJ such that it checks if the written code follows AirBnB’s Javascript style guide. From what I have seen of ESLint and AirBnb’s Javascript style guide, it is nice to have neat-looking code. Although, the standard does have some weird points to it. For example, you must have a new line at the end of your code. I have no idea why this is a point in the standard, but it is in the standard, so I must make that change to the code anyways.

Again, so…

I see coding standards as a positive quality-of-life change for all of us programmers. We should follow a standard so we can easily read code written by programmers of all levels. We do this in order to spend more time trying to improve the code, rather than spending hours upon hours trying to understand the code (assuming no comments or documentation of said code were provided). Finally, we should follow a standard so that our code looks nice.