title: Why are static classes considered “classes” and “reference types”?
body: <p>I’ve been pondering about the C# and CIL type system today and I’ve started to wonder why static classes are considered classes. There are many ways in which they are not really classes:</p>
  
  <ul>
  <li>A “normal” class can contain non-static members, a static class can’t. In this respect, a class is more similar to a <em>struct</em> than it is to a static class, and yet structs have a separate name.</li>
  <li>You can have a reference to an instance of a “normal” class, but not a static class (despite it being considered a “reference type”). In this respect, a class is more similar to an <em>interface</em> than it is to a static class, and yet interfaces have a separate name.</li>
  <li>The name of a static class can never be used in any place where a type name would normally fit: you can’t declare a variable of this type, you can’t use it as a base type, and you can’t use it as a generic type parameter. In this respect, static classes are somewhat more like <em>namespaces</em>.</li>
  <li>A “normal” class can implement interfaces. Once again, that makes classes more similar to <em>structs</em> than to static classes.</li>
  <li>A “normal” class can inherit from another class.</li>
  </ul>
  
  <p>It is also bizarre that static classes are considered to derive from <em>System.Object</em>. Although this allows them to “inherit” the static methods <em>Equals</em> and <em>ReferenceEquals</em>, the purpose of that inheritance is questionable as you would call those methods on <em>object</em> anyway. C# even allows you to specify that useless inheritance explicitly on static classes, but not on interfaces or structs, where the implicit derivation from <em>object</em> and <em>System.ValueType</em>, respectively, actually has a purpose.</p>
  
  <p><strong>Regarding the subset-of-features argument:</strong> Static classes have a subset of the features of classes, but they also have a subset of the features of structs. All of the things that make a class distinct from the other kinds of type, do not seem to apply to static classes.</p>
  
  <p><strong>Regarding the <em>typeof</em> argument:</strong> Making a static class into a new and different kind of type does not preclude it from being used in <em>typeof</em>.</p>
  
  <p>Given the sheer oddity of static classes, and the scarcity of similarities between them and “normal” classes, shouldn’t they have been made into a separate kind of type instead of a special kind of class?</p>