I'll change to:
- don't use collections for reference values where said collections are instantiated several times per frame
And fyi, I think I've managed pretty well in spite of being deathly scared of foreach. A long time ago, in a land far far away, people got along just fine with arrays :)
Shawn, I read your blog all the time; I read your post on optimizing for readability, performance, etc. I believe readability is important, and think a for(i = 0; i < array.length; i++) loop is just as readable as a foreach loop. However, when doing a bit of snippet pasting, I (irresponsible young C# developer) accidentally introduced about 4000ms of GC at least once a minute which had a substantial effect on gameplay--I had to run the Performance Monitor and CLR Profiler to find the culprit foreach calls.
I just think it bears mentioning that [irresponsibly] using foreach, unlike using straight up arrays, can lead to a few days of lost productivity and hair-pulling.