Know your collection of collections

One of the things I have always find to be easily ignored by developers, in some cases even seniors is a good understanding of collecttions available in .NET, how they differ and when to apply which. That is before we even talk about more complex collections that you would not use for common scenarios. It is very important to always apply the right collection to any given requirement. As a basic I think one should be aware of the general collections that are available in .NET. I have compiled an exhaustive list below. I will not provide detail about these collections as I feel it is easy accessible information from other resources such as MSDN.

  • System.Collections.ObjectModel.ReadOnlyObservableCollection<T>
  • System.Collections.ObjectModel.ReadOnlyDictionary<T>
  • System.Collections.ObjectModel.ReadOnlyCollection<T>
  • System.Collections.ObjectModel.ObservableCollection<T>
  • System.Collections.ObjectModel.KeyedCollection<T>
  • System.Collections.ObjectModel.Collection<T>
  • System.Collections.Stack
  • System.Collections.SortedList
  • System.Collections.Queue
  • System.Collections.Hashtable
  • System.Collections.BitArray
  • System.Collections.ArrayList
  • System.Collections.Concurrent.BlockingCollection<T>
  • System.Collections.Concurrent.ConcurrentBag<T>
  • System.Collections.Concurrent.ConcurrentDictionary<T>
  • System.Collections.Concurrent.ConcurrentQueue<T>
  • System.Collections.Concurrent.ConcurrentStack<T>
  • System.Collections.Concurrent.OrderablePartitioner<T>
  • System.Collections.Concurrent.Partitioner
  • System.Collections.Concurrent.Partitioner<T>
  • System.Collections.Specialized.HybridDictionary
  • System.Collections.Specialized.ListDictionary
  • System.Collections.Specialized.NameValueCollection
  • System.Collections.Specialized.OrderedDictionary
  • System.Collections.Specialized.StringCollection
  • System.Collections.Specialized.StringDictionary
  • System.Collections.Generic.Dictionary<T>
  • System.Collections.Generic.HashSet<T>
  • System.Collections.Generic.LinkedList<T>
  • System.Collections.Generic.List<T>
  • System.Collections.Generic.Queue<T>
  • System.Collections.Generic.SortedDictionary<T>
  • System.Collections.Generic.SortedList<T>
  • System.Collections.Generic.SortedSet<T>
  • System.Collections.Generic.Stack<T>
Advertisements