Re:A Year’s Worth of Opinions about Objective-C
by frou_dh on Saturday December 14, 2013 @12:34PM
(#6906305)
You're incorrect about Go. It's in the spec that derefing a nil pointer will cause a runtime panic (~ an exception).
Re:A Year’s Worth of Opinions about Objective-C
by drewcrawford on Saturday December 14, 2013 @12:46PM
(#6906344)
I stand corrected.
Re:A Year’s Worth of Opinions about Objective-C
by pnathan on Saturday December 14, 2013 @04:05PM
(#6907114)
Not defending "undefined" here, at all. I'd rather see the definition be, at least, exit(0xff) (or some other mechanism that reliably denotes "method not found", "message not found", etc).
I'm pretty sure I'm on record in HN for ranting about the fact that C & C++'s undefined & funny behavior literally created multimillion dollar industries in building analysis tools to cove their gaping problems. Which is why I am tend to boost Rust when possible (designed for correctness and determinism! woo!).
Dropping errors is not IMO better or worse. Both are silent failure modes.
In any of those, dereferencing a null pointer is undefined. The compiler can literally emit code that plays Nethack in this situation [0]. ObjC's "nothing will happen" behavior is a significant improvement in safety against similarly-situated languages.
[0] http://feross.org/gcc-ownage/