I think it has a lot more to do with readability. Certain conventions are easier to read. This is especially important as we realize that code is easier to read if we don't have to delve into the context.<p>For example, (I've spent a lot of time in C#,) let's say you have a collection of Foo objects, but you need to convert them to Bar objects. There's two general patterns in C# to do this:<p><pre><code> var bars = new List<Bar>();
foreach (var foo in foos)
{
bars.Add(foo.ConvertToBar());
}
</code></pre>
Versus:<p><pre><code> var bars = foos.Select(foo => foo.ConvertToBar());
</code></pre>
Which one is more readable? If you're a newcomer to the language, or you generally haven't worked with "Select" before, the foreach approach might make more sense.<p>But, as you get used to "Select" and understand what it does, you'll probably come to the conclusion that foos.Select is easier to read, especially if you're looking at code that someone else wrote, where you might not have all of its context in your head.<p>Some other responses in this thread explain the difference by saying that "loops are saying <i>how</i> you want something done, functional is saying <i>what</i> you want done." This also is helpful when reading code where you don't have all the context in your head. (IE, code someone else wrote, or code you haven't worked with in a long time.)<p>To provide an example, you could have an array, int[] in C#:<p><pre><code> var sum = 0;
foreach (var i in values)
{
sum = sum + 1;
}
</code></pre>
Or:<p><pre><code> var sum = values.Sum();
</code></pre>
Both are valid C#. But, the functional approach is much easier to read, because you don't need to understand as much context when comparing the loop approach to using the Sum() method.<p>If you're a novice to C#, a novice programmer in general, or you're merely unfamiliar with Linq, the loop approach might seem easier. It's "not wrong..." But, remember, you're saying "how" instead of "what."<p>A codebase that constantly says "how" instead of "what" ultimately is harder to work with, because it takes longer for everyone to understand each others' code.