Identifiers must have the correct suffix (fxcop)

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

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

+3
source share
2 answers

This is one FxCop rule that I ignore for the very reason that you are describing. I also feel that in most cases this does not add any value. I usually turn it off in all of my projects.

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

  • AvlTreeCollection
  • ImmutableAvlTreeCollection
  • HeapCollection
+4
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

... .

+4

Source: https://habr.com/ru/post/1708040/


All Articles