Tuesday, February 7, 2012

Advantage of IEnumerable - foreach versus for loop

One advantage with using foreach loops in the C# language is that foreach eliminates your need to track indexer variables, such as i or x. The code becomes safer and more robust by hiding all the details from the programmers using the array.


No comments:

Post a Comment