2 ms·
The problem with coding guidelines is that they actually are really difficult to enforce, especially during crunch-times. To quote Carmack, if the compiler allo
by tombert 7y ago
The problem with coding guidelines is that they actually are really difficult to enforce, especially during crunch-times. To quote Carmack, if the compiler allows something, it will end up in the codebase at some point.
Of course, this is also true of Clojure; people will make use of bad JVM libraries because they're available if you follow this logic, F# can do unsafe mutables, and even a more pure language like Haskell allows binding into C.
The difference in how idiomatic and easy it is to do a bad thing. For Clojure, the language has the "right" versions of the main data structures as first-class syntax, making it unlikely that you'd call into a Java library until needed, in which case hopefully you're using the correct one; while calling into Java isn't difficult, it is made explicit, and it does feel a bit unnatural as a result. Since Scala attaches no syntactical stigma to using the "bad" Java conventions, it's common for people to do things in a bad way (e.g. using `var` everywhere instead of `val`).