I have a c# newbie question. What is consider good practice out of the two below too? ...and is list slower or faster than the array?
//Method 1
int[] i_array = { 2, 0, 110, 53455, 2223 };
if (someBolean)
{
Array.Resize(ref i_array, i_array.Length + 1);
i_array[i_array.Length - 1] = someIntValue;
}
//Method 2
var i_list = new List<int>();
i_list.AddRange(new int[] { 2, 0, 110, 53455, 2223 });
if (someBolean)
i_list.Add(someIntValue);