Optional Parameters in C#4, C#3 and VB.Net, With a Side Order of IL.

added by Grumpydev2
4/19/2010 12:52:35 AM

0 Kicks, 73 Views

One of the features C# has gained in it’s latest V4 incarnation is the ability to work with optional parameters. Now VB.Net (and the underlying IL) has had this ability for sometime, but as it’s new to C# folks, and causing a little confusion; I’m going to attempt to explain how it works, when it works and the potential gotchas. I’ll also cover a strange inconsistency between the the VB and C# compilers when it comes to named parameters.