Sometimes I have code where I would like to set a property from editor, and if it is not set, use some logic to set it. If that fails too, throw an exception. As far as I know the official C# Export docs do not provide a method to check if a [Export] value is null. You just get a NullReference exception, when you use it.
But everyone hates null reference exceptions. An elegant(?) solution would be to use a Result type, like in rust. I found vkhorikov/CSharpFunctionalExtensions which implements some of the Result Type, as I want it.
It would be cool to implement the Node Extension functions as Result Types.
Sometimes I have code where I would like to set a property from editor, and if it is not set, use some logic to set it. If that fails too, throw an exception. As far as I know the official C# Export docs do not provide a method to check if a
[Export]
value is null. You just get aNullReference
exception, when you use it.But everyone hates null reference exceptions. An elegant(?) solution would be to use a
Result
type, like in rust. I found vkhorikov/CSharpFunctionalExtensions which implements some of theResult
Type, as I want it.It would be cool to implement the Node Extension functions as
Result
Types.