4 ms·
You wouldn't sum an array of 10 integers using reduce... you'd most likely use fold. Spolsky was talking about the power of abstracting away for loops. Functio
by jganetsk 19y ago
You wouldn't sum an array of 10 integers using reduce... you'd most likely use fold.
Spolsky was talking about the power of abstracting away for loops. Functional programming languages do this all the time, with primitives like map, fold, filter, etc. And this happens without any toll on the programmer's mental burden or the machine's performance.