3 ms·
To my surprise, things can get funnier in the .NET world. There, you can mix and match what C++ does with what this post expects: http://blogs.msdn.com/b/alexgh
by Someone 15y ago
To my surprise, things can get funnier in the .NET world. There, you can mix and match what C++ does with what this post expects: http://blogs.msdn.com/b/alexghi/archive/2010/01/27/visual-basic-hides-virtual-methods-from-c-not-really.aspx http://blogs.msdn.com/b/alexghi/archive/2010/01/27/visual-ba...
- gecko 15y agoThere's a big difference, though: in C#, you can't accidentally mask a base-class function; you have to do so explicitly. If you fail to tell the compiler whether you're overriding, hiding, or replacing, then it's a compilation error. That's a very different beast than the C++ issues discussed in this article.
- Someone 15y agoThat is true, but I still hold that .NET is more complex than C++. With C++, the language made a choice (unfortunately, probably not the best one). With .NET, one can encounter both choices in a single program. "Don't do that" is not suffient here; the two choices might have been made in different third party implementations of a common interface (let's say logger subclass A hides Log(char) in the base class with a Log(int), while subclass B overloads it with a Log(int)) Far-sought? Probably, but still surprisingly complex for a language that tries to be simpler than C++.