title: Why .NET Object has method Finalize()?
body: <p>I know that Finalize method is used by garbage collector to let object free up unmanaged resources. And from what I know, Object.Finalize is never called directly by GC (object is added to f-reachable queue during it's construction if it's type <strong>overrides</strong> the Finalize method by implementing finalizer). </p>
  
  <p>Object.Finalize is only called from <em>autogenerated finalizer code</em>:</p>
  
  <pre><code>try
  {
    //My class finalize implementation
  }
  finally
  {
    base.Finalize(); // Here chain of base calls will eventually reach Object.Finalize/
  }
  </code></pre>
  
  <p>So having an arbitrary class, derived from Object, wouldn't call Object.Finalize - you need finalizer for Object.Finalize to make sense and for most classes it doesn't make sense and is unused (not saying it's implementation is empty in fact).</p>
  
  <p><strong>Would it be too complex to check existence of Finalize method in a class without it overriding Object.Finalize</strong>, and generating root finalizer without try{}finally{<strong>base.Finalize()</strong>} call? Something similar to <code>Add</code> method for collection initializing - you don't have to implement any interface or override that method - just implement <code>public void Add(item)</code> method.</p>
  
  <p>It would complicate C# compiler a bit, but make finalizer run slightly faster by removing one redundant call, and most importantly - make Object class easier to understand without having protected <code>Finalize</code> method with empty implementation while it doesn't need to finalize anything.</p>
  
  <p>Also it might be possible to implement FinalizableObject class, derived from Object and make compiler derive all classes which have finalizer from that. It could implement IDisposable and make the <a href="https://msdn.microsoft.com/en-us/library/b1yfkh5e(v=vs.100).aspx" rel="noreferrer">disposing pattern, recommended by Microsoft</a> reusable without need to implement it in every class. Actually I'm surprised such base class doesn't exist.</p>