"Jason Huang" <Ja************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,
In my C# Windows form MyForm, it has a function MyFunction which is a big
function and has lots of codes.
I am thinking the override for MyFunction, one MyFunction has a parameter
which will pass a value into the function, while the origin MyFunction
doesn't pass that value.
Now comes my question, since the MyFunction is a long function, is the
"Override" for that function a good idea, or there're other better
solutions?
Any help will be appreciated.
1) This isn't override it is overload. Override is when you override a base
class method.
2) It is common practice to simulate default arguments by creating one
method with all the parameters and a overloads with less that just call the
"all parameter" method with the "defaults". I assume that this is what you
intend. On no account use copy and paste.
P.S. I have no idea why C#doesn't support default arguments since it would
be trivial to just implement them in this way