Conversation

"Strong types" /= "Static types", and "Static types" /= "Contracts". Invalid states are often a runtime property. Contracts are a much better tool for representing valid value-states than types are.
Quote Tweet
Pervasive defensive programming is a symptom of a lack of strong types. If your language can make invalid states unrepresentable then you only need to validate input at the edges of your system
2
11
Sure, and you can force contacts to check for nulls. Doesn't mean it's the right tool. For the record, many contracts can also be checked statically. Check out the work by with Whiley.
2
3