Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use a Array() over Generic.Lists in .NET

Tags:

.net

when is it appropriate to use an array over a Generic List(of T) in .NET

I have struggled to see any benefit an array provides over the Generic List but get the feeling I may be missing something. Performance is one thing that struck me as one potential bottleneck ?

Thanks

like image 660
Dean Avatar asked Jan 05 '09 14:01

Dean


1 Answers

When you are using a fixed number of a given type of object there's no point in taking the small performance hit associated with the List class as you won't use any of its features.

like image 76
Garry Shutler Avatar answered Sep 17 '22 20:09

Garry Shutler