logoalt Hacker News

itishappyyesterday at 11:30 PM1 replyview on HN

The Result pattern can be a lot more ergonomic than exceptions.

Microsoft C# guidelines recommend try-parse (which is just the Result pattern, albeit somewhat cludgy with no unions) over exceptions.

https://learn.microsoft.com/en-us/dotnet/standard/design-gui...


Replies

Quarrelsometoday at 1:03 AM

the result pattern doesn't force you to handle the exception though. You can just discard the result.