3 ms·
> Isn't this true for all languages in one form or another? Go and Rust have "panics" Any code might fail exceptionally, stack overflows and out of memory condi
by masklinn 11y ago
> Isn't this true for all languages in one form or another? Go and Rust have "panics" Any code might fail exceptionally, stack overflows and out of memory conditions come to mind as relatively common ones.
The concern does not make sense in Rust, Rust's panics can not be caught and will kill the current thread.
> The difference here is that C# treats more kinds of things exceptionally than Rust or Go.
Or it treats exceptions much less exceptionally than they do (Python being even further along on that axis), a C# exception is at best "uncommon".
> This seems to have more to do with Rust and Go ability to more easily return multiple types from a method/function
Rust doesn't use MRV for results, Result is a single struct (technically an enumerated type which can contain either a "valid result" or an "error result", not both).
> I belive Objective-C did some kind of null lifting where sending messages to null objects don't throw.
Not in the sense you think, Objective-C's nil is simply a black-hole, messages send to it don't do anything and return nil. It's possible (though not probably not recommended) to opt Smalltalk or Ruby[0] into this behaviour, because nil is a standard object not a magical special value (and both languages have open classes).
[0] http://blog.rubyenrails.nl/articles/2008/02/29/our-daily-method-18-nilclass-method_missing http://blog.rubyenrails.nl/articles/2008/02/29/our-daily-met...