by davismwfl · 7y ago · 0 comments
Anymore the easiest way is just setup the standard IDE profile for the language and make sure everyone uses it. This removes 80% of the work and makes it easy for most people. I also like this because I personally have some ways I like code that are contrary to what a lot of people like, so when I setup the IDE it makes it easy for me to stick with the standard versus what I might want to do since it is more work to change it. I found this to be true for most engineers as well.
Overall, I don't like the idea of huge coding standards however, unless the project is a vital system. For example, with embedded devices I like a more strict coding standard because the cost of errors are much higher, but for web I find more lax coding standards acceptable because the risk is usually lower in terms of cost and time. However, the web argument changes when you say there are millions of users of the software, then standards become crucial to quality and reliability.
In the end it comes down to cost to maintain the software and fix defects, standards lower that cost so they are the right thing to do.
Personally for my Javascript projects I've been using prettier with their combined linting rules. I don't like every choice it makes, but it keeps the code clean and consistent.
I also like to make sure the team is down on all the rules you can't auto-format and I like to keep those light. Use es6, no lodash, use native promises, don't use arrow functions to define class methods... that kind of stuff, all very personal and project specific.