Improve readability with LINQ

At first i was not very fond of LINQ but it seems that i am finally convinced that LINQ may improve readability:

bool IsCompleted()
{
 var boxesNotOnGoal = from cell in Cells
                      where cell.HoldsBox() && !cell.IsGoal()
                      select cell.Piece;

 return boxesNotOnGoal.Any();
}

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>