Named Arguments

This may seem trivial but I just recently came across this gem. Named Arguments allow you to specify which argument a value belongs to in a method call. One of its advantages is that it frees you from looking up the order of parameters in the call. Meh! That may be cool for some but I find myself around knowing that answer from intellisense while typing. But an application that is useful is if you have a slew of optional parameters and you only need to adjust one or more further down the line.

The following is a traditional way in which you would adjust a distant optional parameter. You would have to supply all the argument values that proceed it:

Now using named arguments you can call it as follows:

It simplifies the call and makes it easier to know the meaning of each argument at a glance. There have been times in the past where I have used Overloading to bridge the argument gap. Now with Named Arguments, I have another tool in my arsenal to supply arguments in a precise and intelligible way.