Is C# 4 optional parameter implementation the same as VB.NET, the optional parameter is compiled on the call site(can cause versioning problems)?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Yes.
According to SamNg, C#'s default arguments are is compiled at the call site, similar to default parameters in C++.
Yes, it would cause versioning problems. However, optional parameters should be used where it makes sense. In many cases, this means passing
null
or default-constructed class to a method or constructor.