Thursday, September 02, 2010

The AI of ReSharper

I was just typing this…

image

…when ReSharper 5 suggested its “Loop can be converted into LINQ-expression”:

image

You gotta love this!

3 comments:

Anonymous said...

The code does not seem improved to me, so why should I love it?

Dennis Doomen said...

Well, that's a matter of tast, although I typically never wrap the LINQ-statement in a ().ToList() like in the example

Steven said...

Besides the formatting problem (I like to start the 'from' keyword on a new line) this is really awesome and actually IS a big improvement over a series of 'foreach` loops. However, Dennis, to be honest, why did you write three foreach statement anyway?