Are lists better than arrays? And why?
I've always used arrayList in Unity, never had the urge/necessity to use Lists but after so many posts declaring that it's better to use lists than arrays I'm confused.
Why are lists better than arrays and how come, if lists are better arrays are not deprecated?
And, if I keep using arrays will I be tagged later on as a bad programmer?
Regards,
Answer by hrvat · Nov 04, 2015 at 08:29 PM
Think I found the answer to what I was looking for. Copied from: http://answers.unity3d.com/questions/559461/how-to-declare-an-arraylist.html
" When to use regular array and when to use a list? - Use a regular array when you know how many elements you need and you don't expect that number to change (via adding, removing), use it in places where high performance is required. Use a generic list if you need more dynamic acrobatics, like inserting an element at a certain index, removing an element, appending to the end of the list, etc. There's tons of fun stuff you could do with List."