Fabrice's weblog

Tools and Source

News

My .NET Toolbox
An error occured. See the script errors signaled by your web browser.
No tools selected yet
.NET tools by SharpToolbox.com

Read sample chapters or buy LINQ in Action now!
Our LINQ book is also available on AMAZON

.NET jobs

Emplois .NET

Tuneo

ASP.NET Hosting transatlantys

Contact

Me

Others

Selected content

Archives

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

Comments

Bryan said:

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.

# May 21, 2009 8:42 AM