3 ms·
Objective-C does that but it has the effect of separating serious consequences from their causes. Places that really require non-null have a much more difficult
by gilgoomesh 2y ago
Objective-C does that but it has the effect of separating serious consequences from their causes. Places that really require non-null have a much more difficult time finding where the null value originated.
And since Objective-C contained a lot of C, it really just separated null dereferences from their causes making debugging much harder.
- specialist 2y agoThanks for replying. I really appreciate pushback, criticisms, and thoughtful opinions. I don't know Obj-C, so I'll have to research those use cases, to understand better. eg: Are those across processes? Is this an Obj-C idiom? How to make illegal state representations impossible? Per the Null Object pattern description, Null Object captures all of the null handling and behavior in one place, vs scattered around. Stuff like null checks and throwing exceptions. It does not eliminate the need for the concept of null. I'm probably (mostly) wrong about eliminating @NotNull annotations. Especially in method signatures (defensive programming). Last night while commenting, I was thinking about annotating POJOs, to info serialization.