Generally, when you have a variable, you probably intend to use it at some point.

Take, for example, this code:

var dict = new Dictionary<string, string>();
dict.Add("Mi6", "James Bond");
dict.Add("CIA", "Jason Bourne");
dict.Add("Mi5", "Harry Pearce");

var found = dict.TryGetValue("CIA", out var spy);
if (found)
{
  Console.WriteLine($"The spy we want is {spy}");
}

We are creating a Dictionary, adding a Spy, then later requesting the Spy from the particular service.

This code prints the following:

spyResult

Suppose later, our requirements change, and we don’t actually care which Spy it is.

We could, of course, refactor the code like this:

var found = dict.ContainsKey("CIA");
if (found)
{
  Console.WriteLine($"The spy exists!");
}

Alternatively, we can leave the code as is, with a minor change:

var found = dict.TryGetValue("CIA", out var _);
if (found)
{
  Console.WriteLine($"The spy exists!");
}

The change here is this line:

var found = dict.TryGetValue("CIA", out var _);

The underscore here, _ , is a discard parameter.

It basically means that the API call requires a value to be specified (in this case an out parameter), but we don’t actually care what it is in our code.

This enhances clarity as anyone reading that code knows quite clearly the intent of the code.

TLDR

Use discard parameters to signal to anyone reading the code your intent for them.

The code is in my GitHub.

Happy hacking!