Conforming to the Coding Norm

13 Sep 2016

I think coding standards can help the open-source community by making source code easier to read, and thus, easier to contribute to. It’s obvious that if everyone conformed to one standard, then collaborating on a project would be much smoother than if everyone had their own style of coding. Making everything fit a single style allows everyone to read each other’s code, and then contribute which in turn would be read easily, and the cycle would continue. Also, debugging code would be much simpler and faster. If your code is difficult to read and basically gibberish to someone stumbling across it, it would be difficult to find the problem and fix it. However, if the source code were to follow coding standards, then it would be easier and more intuitive to read and understand it, and finding the problem suddenly isn’t as difficult.

ESLint

I have mixed feelings regarding ESLint with IntelliJ. It’s not really difficult to get the green checkmark, but it can be a nuisance, especially in time sensitive tasks such as WODs. Some of the formatting doesn’t really have an impact, such as having a new line at the end of the code, and some of it actually makes things more difficult to read, such as not having new lines or empty space in blocks of code. I would understand if the block were dedicated to a single purpose, but lines within functions can’t even be separated, which definitely adds to the difficulty of reading the code, since it all seems like one giant block of text. On the other hand, it isn’t difficult to follow the standards of ESLint so it isn’t a huge problem, and it can just take 30 seconds to fix any “issues” it detects.

Overall, I don’t particularly feel that coding standards are crucial, nor do I feel that the usage of ESLint is entirely necessary or even beneficial at times, but I can definitely see the merit in it. It’s a boon to group projects and collaboration (assuming every team member follows the same coding standards, otherwise it could be even more of a mess), as having easy-to-read code is always great and promotes efficiency.