4
Shouts

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

published 1128 days, 13 hours, 10 minutes ago posted by http://www.grumpydev.com/http://www.grumpydev.com/ 1129 days, 18 hours, 2 minutes ago
Tuesday, April 20, 2010 12:46:00 PM GMT Monday, April 19, 2010 7:53:53 AM GMT

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.

category: How To | clicked: 0 | | source: www.grumpydev.com | show counter code
tags: C#, VB.NET, ildasm, Named Parameters, CSharp 4.0, Optional Parameters, CSharp, IL