4 ms·
I want to provide a counterargument to #4 'Be strict about best practices even if they seem negligible' is horrible advice. I often run into cases where somet
by BigJono 9y ago
I want to provide a counterargument to #4
'Be strict about best practices even if they seem negligible' is horrible advice.
I often run into cases where something needs to be laid out differently to what the 'best practices' recommend for the sake of readability. I've worked with several popular linting configs for Javascript and over time I've found myself or my team paring them back to just the basics in order to make them usable.
Even the basics provide dubious value in my opinion. A basic linter provides great value if you hire droolers that can't figure out basic indentation. But if you're doing that then you have serious problems and no amount of corralling is going to save you.
Past that, I've never once seen any real value come from something like mandating semicolons, or a lack thereof. I feel like actually caring whether the file you're opening has or doesn't have semicolons is a clear sign of an inexperienced programmer. It makes zero difference to my workflow, and IME experienced devs will just carry on whichever style is already in place without even a second thought, linter or no.
In my experience the absolute worst case scenario in terms of code readability (assuming you haven't hired anyone completely incompetent) is when your dev team is twisting themselves in knots trying to adhere to linter rules when they should just trust their instincts about what is readable and what is not.
- sanderjd 9y agoHaving a standard style is valuable precisely because it's a waste of time to debate or care about this sort of thing. The value of being strict is that tools can do a strict formatting automatically with zero human input. In other words, for this sort of style stuff, a formatter that everyone uses is much better than either a linter or a "trust your instincts" approach.
- nallerooth 9y agoI can't upvote this enough. We decided to go with a given set of rules for linting at the project start and problems due to limitations by the linter have been extremely rare, in which case we've updated the rules because we can motivate a change. Of course, a tool like 'go fmt' is far superior to common linters, as most third party packages look the same as your own code.
- sanderjd 9y agoYep. I think go fmt is the most state of the art thing in Go, and that every language should prioritize having the something similar built in.