ASP.NET Hosting

ForEach debate continued

Eric Lippert, whose blog you shouldn't miss, adds his own arguments to the debate about whether using a ForEach extension method instead of foreach is a good idea or a bad one.

I don't see a definitive answer to the question. All the arguments given here and elsewhere are good, but in the end, it's up to you to decide what you prefer to do.
Read the posts and the comments to make up your own mind.


Cross-posted from http://linqinaction.net

1 Comment

  • When my code is smaller and still readable, I use ForEach. When it becomes unreadable, I fall back to foreach. I try to keep the # of lines I have to maintain down while not sacrificing readability.

Comments have been disabled for this content.