Optional Parameters and Method Overloads
The ability to declare optional parameters is another feature that will be introduced in C# 4.0. A natural complement to method overloads, it generally helps code to be more concise. Until now, method overloads have been used for the awkward responsibility of creating default values for what otherwise would be much better expressed as optional parameters. Many overloads have been created for which the sole responsibility is to call another overload with some default values for some parameters. public CreditScore CheckCredit() { return CheckCredit(false, true); } public CreditScore CheckCredit(bool useHistoricalData) { return CheckCredit(useHistoricalData, true); } public CreditScore CheckCredit( bool useHistoricalData, bool useStrongHeuristics) { // do the heavy-lifting ... } For this style of method, optional parameters let you create just one method, with default values set on its signature. public CreditScore CheckCredit( bool useHistoricalData = false, bool u...