Thanks for the Info Divil, it all makes sense. But at the same time, Optional Parameters really can be helpful. When using the Excel Object Model, for example, there are a lot of option al parameters, so in VB.Net you can call Workbooks.Open() as follows:
Code:
Dim wb As Excel.Workbook = _
xlApp.Workbooks.Open("C:\YourPath\YourWorkbook.xls")
But the reality is that you are dropping a lot of Optional parameters at the end. In C#, which cant do this, you are forced into the following:[VB]Excel.Workbook wb = xlApp.Workbooks.Open(
"C:\\YourPath\\Yourworkbook.xls",
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);[/code] This is an ugly call.
Now, the Developer can be accomodated by using Overloading. This would allow the C# call to drop all these explicit Type.Missing values. But this merely passes the burden to the Programmer, for making all these overloaded versions is definately more work than creating Optional Parameters with Default Values.
And losing IntelliSense over what these default values are seems unfortunate as well. Oh well, just have to get used to it, I guess...