Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Since there is no optional type in the standard library, you need to pull in an external library: If an optional type is added to the standard library in the future, it may be incompatible. ...
#1: Initial revision
Since there is no optional type in the standard library, you need to pull in an external library: * If an optional type is added to the standard library in the future, it may be incompatible. * Larger projects can (transitively) depend on multiple incompatible implementations. Most implementations are "incomplete", seemingly trivial tasks become a challenge: * [Deconstruction][1] of optional types for switch statements. * Conversion between nullable and optional types. * Alternatives to `SingleOrDefault` for optional types. * Serialization to/from JSON. * Issues with nullability of inner type (e.g. `Option<Class1>` vs `Option<Class1?>`). Usage of optional types can also cause social problems: * For efficient usage, developers need to be familiar with the implementation. * Another team might decide against using optional types but need to use them to utilize a shared library. [1]: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/deconstruct