this post was submitted on 10 Aug 2024
15 points (94.1% liked)

C Sharp

1510 readers
1 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS
 

A collection of tools for dealing with nulls, failures and the generic type issues that arise in this domain.

https://github.com/Andy3432344/SafeResults

I'm the author, let me know what you think!

*Edit: updated to show GitHub link, sorry!

you are viewing a single comment's thread
view the rest of the comments
[–] kogasa@programming.dev 2 points 1 month ago

You can't disagree with the fact that Nullable works a lot like an Option. Returning an error is not idiomatic C# code (which would be to throw an exception usually) but if you wanted that, you'd use a Result<T, TError> type or similar.