Monday, February 13, 2006

Default Arguments (to use or not to use)...

The case of whether default arguments should be used or instead function overloading should be is a topic that isn't so hotly debated anymore. It appears to be a rarer and rarer occurance that default arguments should/can be used.
At least for .NET (not an issue in C#) default arguments should not be used. It's simply a case of when code is compiled against a library the default value is placed in the calling binary. Meaning if a library changes it's default value, the value won't be changed in an assembly using that library until it's recompiled.

No comments: