Question

I got this error for a collection I am writing, but fxcop warned me to suffix it with collection. Why?

No .NET collection does this, right? i.e. List<T>, LinkedList<T>, etc.

Was it helpful?

Solution

This is one FxCop rule I ignore for pretty much the exact reason you describe. also I feel that in the majority of cases it adds no value. I usually turn it off in all of my projects.

The second reason is that if you follow the rule, it produces some really odd class names (especially when combined with Tree)

  • AvlTreeCollection
  • ImmutableAvlTreeCollection
  • HeapCollection

OTHER TIPS

System.Collections.ObjectModel.ObservableCollection<T>
System.Collections.Generic.SynchronizedCollection<T>
System.Collections.Generic.SynchronizedKeyedCollection<K, T>
System.Collections.ObjectModel.ReadOnlyCollection<T>
System.Collections.Specialized.NameObjectCollectionBase.KeysCollection
System.Windows.Forms.ListViewGroupCollection
System.Windows.Forms.ListView.ListViewItemCollection

...amongst others.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top