3 ms·
> If the goal was to make zero values useful, Go should have rather have offered Obj C-style messages to truly nil interfaces - nothing happens and all values r
by fshbbdssbbgdd 6y ago
> If the goal was to make zero values useful, Go should have rather have offered Obj C-style messages to truly nil interfaces - nothing happens and all values returned are zero.
IMO this is the worst thing about Obj C. The number of times I’ve discovered code that was silently failing in some Obj C project.....
- morelisp 6y agoNow imagine it silently failed half the time, depending on whether or not the nil had crossed an otherwise innocuous function boundary. That's Go.
- philosopher1234 6y agoI don't understand how you can characterize Go as silently failing half the time? Can you give an example of this "silent arbitrary failure"?
- morelisp 6y agoIt's literally the whole thread man. Boxed nils are nils-but-also-not-nils, and knowing if something gets boxed means knowing whether the exact function parameter signature (in or out) is an interface or concrete, not just whether what you are returning is of the appropriate type. (And Go has no special syntax for interface vs. concrete types in parameters, so you not only need to read the signature but the definition of the type.)
- philosopher1234 6y agoI read the thread, but no one ever explained why this matters or would come up in the real world? Just a lot of bluster