3 ms·
> Fun3().Fun2().Fun1() Hope you like Null Pointer Exceptions. (And poorly named methods.)
by Jach 10y ago
> Fun3().Fun2().Fun1()
Hope you like Null Pointer Exceptions. (And poorly named methods.)
- alkonaut 10y agoNeither the function names or whether a type systems has null or not depends on the paradigm (functional/OO/imperative/procedural/whatever). I prefer type systems without null if given the choice, but for composition there isn't much different between result|error and result|null (If the null/error case is actually handled. Unless you use C you can usually handle it with something that resembles modads or is at least a pattern matching shorthand C# var managerStreet = employee.Manager?.Address?.Street; Which is very similar looking to how Rust (Which has no null) propagates errors: foo()?.bar()?.baz()?
- kazagistar 10y agoAfaik using `?` for `Option` is part of the `Carrier` trait which is unstable and only in nightly Rust for the time being.