What happens to C# 4 optional parameters when compiling against 3.5?
Heres a method declaration that uses optional parameters: public Path Copy( Path destination, bool overwrite = false, bool recursive = false)
Something you may not know is that Visual Studio 2010 will let you compile this against .NET 3.5, with no error or warning.
You may be wondering (as I was) how it does that. Well, it takes the easy and rather obvious way of not trying to be too smart and just ignores the optional parameters. So if youre compiling against 3.5 from Visual Studio 2010,...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.