logoalt Hacker News

seanalltogetheryesterday at 4:05 PM4 repliesview on HN

At this point in my career, I can't go back to a language that doesn't have support for Optionals or compiler validation of nullable types. I can sacrifice async or fancy stream apis, but I will never go back to chasing null pointer exceptions on a daily basis.


Replies

iainmerrickyesterday at 4:15 PM

Obj-C does have a "nonnull" annotation now (apparently added to assist Swift interop). One of the final jigsaw pieces turning it into a really pleasant language.

show 2 replies
tarentelyesterday at 4:20 PM

I don't think objc has the equivalent of a null pointer exception. You can freely send messages to a deallocated object. Since ARC, it is rare, at least in my experience, running into any memory related issues with objc.

show 3 replies
mpweiheryesterday at 9:44 PM

Objective-C did not have null pointer exceptions, though some libraries added them.

coliveirayesterday at 6:15 PM

If you use Objective-C objects, operations on null pointers are just a no-op, so there is not such thing as chasing exceptions.