Joan Venge
Joan Venge

Reputation: 331590

Identifiers should have correct suffix (fxcop)

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.

Upvotes: 3

Views: 524

Answers (2)

JaredPar
JaredPar

Reputation: 755587

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

Upvotes: 4

Fredrik M&#246;rk
Fredrik M&#246;rk

Reputation: 158409

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.

Upvotes: 4

Related Questions