3 ms·
There'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 whet
by gecko 14y ago
There'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 14y 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++.