title: What scenarios does it make sense to use "method hiding"?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1193848/method-hiding-in-c-sharp-with-a-valid-example-why-is-it-implemented-in-the-fram">method hiding in c# with a valid example .why is it implemented in the framework.? what is the Real world advantage.?</a>  </p>
  </blockquote>
  
  
  
  <p>I am wondering how method hiding could be useful in c# ? If you dive into the concept ,you can find that method hiding is something <strong>confusing</strong> and drives us to <strong>spaghetti code</strong> style.There are some reasons for that :
  <p>
  1- If you need a fresh method in your Derived class you can define a new method with a new name in your derived class.
  <p>2-In a polymorphic manner usage when you use upcasting, the expected behavior would not be achieved and this could be confusing.</p>
  
  <p><em>(Specially this strange behavior could be so apparent and obvious if the Base class and the Derived Class were in the different libraries and you want to have a polymorphic usage of them in somewhere in your code)</em> </p>
  
  <pre><code>class Base
  {  
      public void Method() { Console.WriteLine("I am Base Class"); }
  }
  class Derived: Base
  {
      public new void Method() { Console.WriteLine("I am Derived Class");}
  }
  class Program
  {
      static void Main(string[] args)
      {
          Base C = new Derived();
          C.Method(); //output:"I am Base Class"
      }
  }
  </code></pre>
  
  <p>Such a behavior could be confusing, but If we used "<em>virtual</em>" in "<strong>Base</strong>" and "<em>override</em>" in "<strong>Derived</strong>" (I mean a polymorphic usage) the output was: "I am Derived Class". 
  and this output is what that I think the most of us expected.</p>
  
  <p><em>In other words I believe that in a hierarchy, most of developers expected for overridden methods in a derived class Not New methods that wanna hide the base class implementation.</em></p>
  
  <p>I cant understand why such a bad thing that has no advantages there is in c# language? at least I want to know what is the best usages of method hiding in c# ?  </p>
  
  <p>thank you for your help</p>