Optional parameters are not quite the same as either params[] or
overloading, but overloading usually serves fine.
Where VB's optional parameters come in handy, really, is when you call
into those obscene automation APIs in Office and elsewhere ... you know,
the ones where you have twenty-five parameters and you only need to use
the first two, and furthermore, you likely will never use the other
twenty-three. You can make the same call in C#, but it requires more
effort.
This little convenience is why VB is preferred by some for automation
work, although I suspect it either increases call overhead or involves
late binding under the hood. But it's an edge case. For everyday work,
overloading does the job and arguably does it better.
--Bob
Joe Cool wrote:
I take it Optional Parameters for functions are not supported in
C#.NET. Is there a workaround of some type?