Microsoft's documentation for the out parameter modifier points out the following:
Declaring a method with
outarguments is a classic workaround to return multiple values. Consider value tuples for similar scenarios.
This strikes me as a remarkably good point. What use case remains for out, now that we have value tuples?
One major use case I can think of off the top of my head are
Try...methods that return a value and a boolean so that you can check whether the action succeded or not:With the
outparameter, the notation is cleaner and results in less lines (and doesn't require you to create a local variable for the success boolean). It also allows you to do this:With tuples, this would look like this: