Post

Working with the result pattern

Series: Working with the result pattern

A four-part series explaining the result pattern.

Part 1 - Replacing Exceptions-as-flow-control with the result pattern

Explaining what the result pattern is - an alternative to using exceptions for normal control flow - with an example of implementing using both patterns.

Part 2 - Safety and simplicity with LINQ

Improving the code from the previous part by using LINQ.

Also pointing out that this pattern is only meant for replacing control flow exceptions, not all exceptions.

Part 3 - Adding more extensions to Result<T>

Adding more extension methods and async methods.

Part 4 - Is the result pattern worth it?

Comparison to the result pattern and F# (functional programming).

Considerations about when to use the result pattern, eg async makes it complicated.

The series seems to start with defending against people’s abhorence of the result pattern, and seems to end a little dissappointed with the defence :cry:

This post is licensed under CC BY 4.0 by the author.