Behind the Brain

A blog about life, the universe, and everything else

 

C# and default parameters

 

I’m currently porting a C++ library to C# and I really start to miss default parameters in C#

When I have the function

void doSomething( int param1=0, int param2=1, int param3=2, int param4=3 )

I would have to create 5 (in words *FIVE*) overloads for this method… This really sucks… and all just because the guys at Microsoft where too lazy to implement them.

I really love C# but this is something that really annoys me *sigh*

 

No Responses to “C# and default parameters”

 

Leave a Reply