Here is my strategy for choosing the type of use of C #:
if the number of elements in the collection is fixed, then use an array , for example:
string [] direction = new string [] {"north", "south", "east", "west"};
otherwise always use List<T>
unless, of course, you need a more specialized collection, for example. Stack<T>, Queue<T>, or Dictionary<TKey, TValue>
but never again use an ArrayList
Based on your experience, what is missing from this strategy?
collections design c # data-structures conceptual
Edward tanguay
source share