No Standard Deviation

21 Sep 2017

Imagine a highway that has everything you’d expect from a highway. The only thing is, the lights last different amounts of time every cycle, the dashed lines that separate lanes have different lengths, and only half the people use their turn signal. Well, that last one is the norm unfortunately, but that’s the point! Without standards, navigating code is like navigating an awful road system, even if it works. The whole process is going to take much longer and be awful to get through. Standards mean consistency, and consistency means you can make assumptions about how to go about doing something.

Personally, I’m still learning and getting used to some of the less (easily) automatable parts of coding standards but I still feel they’re helpful to implement. In the same way that people who don’t use their turn signals properly (when changing lanes, your turn signal is for showing intent, not warning!) add unnecessary variables to driving, people who don’t adhere to coding standards add variables to anyone that has to maintain or update anything they write. It always helps to have a readme, but being able to assume the nature and structure of code is always going to be faster than having to refer to reference material.

There’s really only so many ways I can say that coding standards just make people’s’ life easier. The main drawback is having to learn different standards for different applications. Going back to driving, people don’t often have to get used to the standards of driving in different countries, or even states, that often. Having to learn and apply standards for different languages in different environments under different contexts is a pain, but it seems to be worth the time in the end.

I imagine at the upper level of any coding community, coding standards will be followed in some form. As long as code needs to be maintained, people will need to follow some kind of standard somehow. It’s just practical that way.

ESLint is only as annoying as something one would expect to find in an IDE. It’s easy to implement and isn’t really invasive; it’s just a little checkmark in the corner. It helps with getting style right, and I can’t really fault it anything. I’m not really a fan of some of the typo detection, but if that’s part of coding standards then I guess I’ll just have to go with it.