C#/.NET Little Pitfalls: The Default is to Hide, Not Override

added by BlackRabbitCoder
7/21/2011 6:31:59 PM

118 Views

C# is a wonderful language for modern programming.  While everything in C# has a reason and a place, occasionally, there are things that can be confusing for a developer who isn’t aware of what is happening behind the scenes. Today we are going to look at a potential pitfall that can bite developers who expect the default behavior of declaring the same method (with same signature) in a subclass to perform an override. In particular, if the developer came from the C++ world, this may run counter to their expectations. While the C# compiler does a good job of warning you of this event, it is not an error that will break your build, so it’s worth noting and watching out for.


0 comments