mmm. but this is true also for array.foreach and array.map etc. and i find those much nicer and simpler. I love reduce. but i kind of agree with the rant in the tweet to some extent
I'm just repeating the only argument against reduce I think it make sense. By some misfortune reduce doesn't seem to "click" with people in the same way map, filter or forEach do.
mmm. but this is true also for array.foreach and array.map etc. and i find those much nicer and simpler. I love reduce. but i kind of agree with the rant in the tweet to some extent
I'm just repeating the only argument against
reduce
I think it make sense. By some misfortunereduce
doesn't seem to "click" with people in the same waymap
,filter
orforEach
do.which is a shame, because
map
,filter
, andforEach
are justreduce
in disguise.Though, for completeness, all of those are just loops in disguise (which isn't an argument for or against it).
Only if you consider loops and tail recursion to be the same thing, which is debatable.
Also, it's only the same when applied to lists.
Other monadic structures may not act as loops at all, when called with
reduce
akafold