2
Shouts

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

published 670 days, 11 hours, 4 minutes ago posted by BlackRabbitCoderBlackRabbitCoder 671 days, 19 hours, 45 minutes ago
Saturday, July 23, 2011 8:13:37 AM GMT Thursday, July 21, 2011 11:31:46 PM GMT

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.

category: Web Dev | clicked: 10 | | source: www.blackrabbitcoder.net | show counter code
tags: .NET, hide, override, C#, CSharp, Little Pitfalls