| ▲ | seanalltogether 5 hours ago |
| 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. |
|
| ▲ | iainmerrick 5 hours ago | parent | next [-] |
| 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. |
| |
| ▲ | plorkyeran an hour ago | parent | next [-] | | nonnull doesn't really do anything in pure objc. It warns if you assign the nil literal to a nonnull pointer and that's it. The annotation is almost entirely for the sake of Swift interop (where it determines if the pointer is bridged as an Optional or not). | |
| ▲ | catoc 3 hours ago | parent | prev [-] | | It is a really pleasant language, but I think the <nonnull> annotation is for initialization only - compiler checking against initializing an object ptr with a null value - and does not prevent crashing when addressing an already released object |
|
|
| ▲ | tarentel 5 hours ago | parent | prev | next [-] |
| 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. |
| |
| ▲ | 4 hours ago | parent | next [-] | | [deleted] | |
| ▲ | Me1000 4 hours ago | parent | prev [-] | | You can send messages to null, sendings messages to a deallocated pointer is going to be a bad time. | | |
| ▲ | e28eta 4 hours ago | parent [-] | | It’s nice not to crash, but unexpected null can still cause bugs in ObjC when the developer isn’t paying attention. Having done both ObjC with nonnull annotations, and Swift, I agree that it’d be hard to forgo the having first-class support for Optionals |
|
|
|
| ▲ | coliveira 3 hours ago | parent | prev [-] |
| If you use Objective-C objects, operations on null pointers are just a no-op, so there is not such thing as chasing exceptions. |