Monday, February 24, 2020

discards in C# 7

When you assign something to a variable that only has an underscore for a name (and you didn't make the underscore as a variable yourself) you are making a throwaway assignment to a variable that will just die without use. It is a discard. Part of the reason for this is that you may now, as of version 7 of C#, hydrate several variables from a tuple and you may not want all of them. Some can be discards.

No comments:

Post a Comment