2 ms·
This would be cool as a comparison to traditional null handling (i.e. crashing). But the comparison to Swift is ridiculous. This begs for overlooked nulls to si
by happytoexplain 5y ago
This would be cool as a comparison to traditional null handling (i.e. crashing). But the comparison to Swift is ridiculous. This begs for overlooked nulls to silently create logic bugs.
Also, the author admits there are two kinds of null in Swift, as compared to four in Obj-C. Is the second kind he's referring to `NSNull`? Doesn't that only exist to bridge with Obj-C APIs that haven't been updated yet? That's pretty misleading, if so.
- astrange 5y agoNSNull is used to store nulls in NSDictionaries when you really want them to, since they don't allow storing `nil`. An example being decoding JSON, which does allow it.
- happytoexplain 5y agoI was thinking that counted as one of the "Obj-C APIs that haven't been updated yet", but I guess it's not actually going away since it's qualitatively different from Swift's Dictionary (being a reference type instead of a value type).