Common error #7: Using the wrong collection type for the task at hand C # provides a large collection of object types, with only a subset of them listed below: Array,arraylist,bitarray,bitvector32,dictionary<k,v>,hashtable,hybriddictionary,list<t>, Namevaluecollection,ordereddictionary,queue, Queue<t>,sortedlist,stack, Stack<t>,stringcollection, StringDictionary. But in some cases, too many choices are as bad as not enough choices, and so are the collection types. A large number of options will certainly ensure that your work is working properly. But you'd better spend some time searching and understanding the collection type in advance to choose a collection type that best suits your needs. This will eventually make your program perform better and reduce the likelihood of errors. If you have a collection that specifies an element type (such as a string or bit) and you are working on it, you should prefer to use it first. This collection is more efficient when the corresponding element type is specified. |