3 ms·
So because a lot of people don't use best practises that means the language in which these are to be used is worse off? It strikes me a bit like saying "becaus
by zaarn 9y ago
So because a lot of people don't use best practises that means the language in which these are to be used is worse off?
It strikes me a bit like saying "because most people don't wear seatbelts, cars are unsafe because you may get ejected out of the cockpit in a crash". Wear a seatbelt and use linters, I'm not going to excuse the malpractices of the larger industry.
- junke 9y agoThat means that you better have safe defaults in a language, rather that opt-in linters.
- zaarn 9y agoMore safe defaults also means I have to think more about escape hatches. Sometimes ignoring an error is the intended way of operation, although rare. Same goes for some other parts of the go coding standards. Sometimes you need to violate them and having to first use some escape hatch like Rust's unsafe is annoying. I'd rather just keep track of linter complaints.
- junke 9y agoYes, ignoring an exception is an explicit move when the default mechanism is to abort execution. Since it is rare, I don't see a problem. > I'd rather just keep track of linter complaints. Do you dislike "unused variables" being compilation errors, too?
- zaarn 9y agoNot really. It has changed my coding style so I now only add variables when needed, even in languages like JS. I only get the "unused variable" error about once a month.
- pjmlp 9y agoNo, it follows junke answer. Optional external tools, are exactly that, optional. Lint was created for C in 1979, a minority used it or its commercial versions like Gimpel, until clang was introduced with static analysis built into the compiler. Anything that isn't enforced by the language, tends to be ignored, hence why we need good defaults that make workarounds a big pain.