3 ms·
Runtime type checking is useless. If a given function can't accept the data I plan to send into it, I want the compiler to tell me immediately.
by fbonetti 9y ago
Runtime type checking is useless. If a given function can't accept the data I plan to send into it, I want the compiler to tell me immediately.
- tmountain 9y agoI think useless might be a stretch. While I certainly prefer compile time checks as well, spec is a huge step forward for folks that are committed to Clojure. If there was no merit to runtime checking, Haskell wouldn't have QuickCheck and would exclusively rely on compile time checking.
- Jach 9y agoThat way lies SOAP, and it's not the compiler that tells the client it can't call an API some way but a broader build tool. And you still need some runtime verification somewhere on the server anyway since without it nothing stops any arbitrary stream of bytes. My own related exaggeration is that type declarations without performance gains are useless. Get them out of my dynamic langs unless you can deliver the performance goods. (Like Common Lisp can. It can also tell you you're stupid locally trying to make an invalid call, at compile time, since COMPILE is built-in.)