3 ms·
>Higher-order functions do entail a sacrifice to readability compared with plain loops. I disagree with you there. If you understand that Map, Reduce and Filte
by jkush 19y ago
>Higher-order functions do entail a sacrifice to readability compared with plain loops.
I disagree with you there. If you understand that Map, Reduce and Filter (for example) are essentially loops, using them greatly increases code readability. Instead of having to read loop code, you're just reading code that describes what you're doing to the data.
EDIT: I know this is going to sound weird, but I recently implemented Map, Reduce and Filter in VB.NET. Aside from the fact that using .NET delegates is clumsy, the code portions that use those methods are much more concise (and readable).