Is the List.ForEach() method gone?

后端 未结 3 1529
孤街浪徒
孤街浪徒 2020-12-03 02:48

I started dabbling in Windows 8 metro recently, and found that one of my old buddies seems to have gone missing.

I tend to use the .ForEach() method mor

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 03:01

    To get a sense for why it might no longer be included, read this post by someone who works on the C# team at Microsoft: http://blogs.msdn.com/b/ericlippert/archive/2009/05/18/foreach-vs-foreach.aspx

    Basically, it's philosophy. The "LINQ" features are highly inspired by the functional programming paradigm, and the ForEach extension flies in the face of that... it encourages poor functional style.

提交回复
热议问题