title: Why have HashSet but not Set in C#?
body: <h2>Old question</h2>
  
  <p>My understanding is that C# has in some sense <code>HashSet</code> and <code>set</code> types. I understand what <code>HashSet</code> is. But why <code>set</code> is a separate word? Why not every set is <code>HashSet&lt;Object&gt;</code>?</p>
  
  <h2>New question</h2>
  
  <p>Why does C# has no generic <code>Set</code> type, similar to <code>Dictionary</code> type? From my point of view, I would like to have a set with standard lookup/addition/deletion performance. I wouldn't care much whether it is realized with hashes or something else. So why not make a set class that would actually be implemented as a <code>HashSet</code> in this version of C# but perhaps somewhat different in a future version?</p>
  
  <p>Or why not at least interface <code>ISet</code>?</p>
  
  <h1>Answer</h1>
  
  <p>Learned thanks to everyone who answered below: <code>ICollection</code> implements a lot of what you'd expect from <code>ISet</code>. From my point of view, though, <code>ICollection</code> implements <code>IEnumerable</code> while sets don't have to be enumerable --- example: set of real numbers between 1 and 2 (even more, sets can be generated dynamically). I agree this is a minor rant, as 'normal programmers' rarely need uncountable sets.</p>
  
  <p>Ok, I think I get it. <code>HashSet</code> was absolutely meant to be called <code>Set</code> but the word <code>Set</code> is reserved in some sense. More specifically, creators of .NET architecture wanted to have a consistent set (sic!) of classes for different languages. This means that every name of the standard class must not coincide with any keyword in the .NET languages. The word <code>Set</code>, however, is used in VB.NET which is actually case-insensitive (is it?) so unfortunately there is no room for maneuvre there.</p>
  
  <p>Mystery solved :)</p>
  
  <h1>Epilogue</h1>
  
  <p>The new answer by Alex Y. links to the <a href="http://msdn.microsoft.com/en-us/library/dd412081%28VS.100%29.aspx" rel="noreferrer">MSDN page</a> which describes  the upcoming .NET 4.0 interface <strong><code>ISet</code></strong> which behaves pretty much as I thought it should and is implemented by <code>HashedSet</code>. Happy end. </p>