Re:Why Clojure?
by stingraycharles on Saturday August 24, 2019 @05:37PM
(#20789861)
We use spec a lot, using orchestra’s defn-spec combined with expound for improved error reporting.
It’s not a type system, but it’s very concise and easy to add validations to important functions. This removes the “lazy and undisciplined” part of the equation.
Basically you says if a type system is optional, people tend not to use it, because most of the times they are good without it.
I agree.
But we do use spec very successfully for complex data structure validations and example data generation.
I understand the idealist world view is seductive — we'll be discipined, we'll write the tests, we'll make good use of Spec, etc etc.
In reality, I have never seen this happen. Humans are lazy and undisciplined, so that's what I optimise for.