Wednesday, October 19, 2011

I'm still not great at lambdas.

I'm still not great at lambdas. I don't find them intuitive. Resharper found that I could refine this...

foreach(Program program in programs) foreach(ProgramPlan programPlan in programPlans) programPlans.Add(programPlan);

 
 

...to this...

foreach (ProgramPlan programPlan in programs.SelectMany(program => programPlans)) programPlans.Add(programPlan);

 
 

...but I wouldn't have seen it by myself. I'm also frustrated by var and having to reverse engineer what a variable really is. I guess I'm trapped in 2005. :(

No comments:

Post a Comment