2 ms·
You're right, you could certainly experience the pain in a non-OO language that silently allows invalid values to creep through the system. However, it's an err
by moomin 10y ago
You're right, you could certainly experience the pain in a non-OO language that silently allows invalid values to creep through the system. However, it's an error _every_ OO language makes. Smalltalk, Objective-C and Clojure dodge it, but they don't dodge it for long: the nulls can now propagate further through your program, making it harder to track your problem down.
I'm not sure your last point buys us anything. I mean, any runtime environment can have bugs, and any future system can have cases you haven't handled. This will break your OO code just as fast as pattern-matching. Because OO dispatch is really just a special case of more general mechanisms.
Have a chat to some purescript guys about when they have trouble with JavaScript nulls. I bet the answer is "when we interface with raw JavaScript code and don't define our types correctly".