3 ms·
No, "design-by-contract" is a matter of degrees, and pure functional languages tend to afford the most extreme degree. Most other languages have easier to acces
by p4wnc6 10y ago
No, "design-by-contract" is a matter of degrees, and pure functional languages tend to afford the most extreme degree. Most other languages have easier to access backdoor escape hatches, but also have other benefits, like faster dev time, wider standard library, less esoteric math knowledge needed to understand the language's core abstractions, etc.
Depending on just how easy the escape hatches are, just how secure you'd like them to be, and just how valuable the other benefits are, you just make some engineering trade-off as to which sort of language makes the most sense.
All I'm saying is that some part of this trade-off space includes staying in a language like Python for its benefits (access to a turn-key machine learning library and rapid development time, say) but needing to build your own machinery to eliminate some of the escape hatches (like decorator-based argument and return value constraints, as in the article).