News, code, articles, rants; a daily dose of programming rigmarole.
Thursday, February 22, 2007
Answer to What's Wrong With This Code
I can't believe it's Thursday already!! Yes, I forgot to post the answer to the previous problem yesterday, so here it is:
Looks like 3_4 on 7 got it right:
Looks like 3_4 on 7 got it right:
3 comments:
-
Anonymous said...
-
Properly written, it supports optional parameters... It's called constructor overloading :) Toss in a little bit of constructor chaining and you save yourself from code duplication.
C# rules! -
February 22, 2007 at 11:18 AM
-
Anonymous said...
-
Actually, in this instance, you weren't constructing the object...Just building a function/method so let's just say that method overloading is what we desire here...
Principle of chaining still applies. :)
And C# still rules. -
February 22, 2007 at 2:37 PM
-
Anonymous said...
-
Mr Muteness,
It seems you know a lot about computers. I am an old person from Stuart, Florida and I was wondering if you could answer a question for me.
If I get Microsoft put on my computer, will I internet? -
February 28, 2007 at 9:20 AM
Subscribe to:
Post Comments (Atom)

I don't believe this would compile. I'm not sure what the output would be but, since C# does not support optional parameters, I believe you're required to supply a value for all of the parameters, including the optional parameters.
However, the VB developer in this instance should make sure that their code is never going to be in a library that is being used by another language as including a universally unsupported concept like optional parameters would be poor development practice.