Proper way of returning multiple values from a method

Since C# 7 you can make method signatures which correspond to multiple values

In Python, you can return multiple values from a function. This functionality is not however built-in into C#, shame. I think this is a nice feature of the language. It frequently reduces asymptotic complexity (i.e. "performance") without resorting to implementing another class to do it.

There are really 2 solutions to this problem: either arrays or custom class. Obvisouly, arrays are no good: you can't mix types.

Alternative is to implement a private class which would return the data one wants:

I don't really have an issue with that other than naming can frequently be awkward and this looks like a lot of work for something that should be rather trivial.

The third alternative, and should address this issue: Tuples. They are the recommended way to return multiple values from a function.

and to extract the values from the Tuple we use predefined property Item1, Item2, Item3, etc... . Tuples can be created with up to 8 values (but if you are returning more than 2 or 3 than we have a code smell).