Alex Rivera | Logout

Method overloading vs optional parameters in C# 4.0

Asked 2010-07-23T08:09:42.320
130

Which one is better? At a glance, optional parameters seem better (less code, less XML documentation, etc), but why do most MSDN library classes use overloading instead of optional parameters?

Is there any special thing you have to take note of when you choose to use optional parameters (or overloading)?

Edit
Report

1 Answer

4

A good place to use optional parameter is WCF since it does not support method overloading.

answered 2010-10-18T16:22:45.537

Your Answer