‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. elgertam · · focus · HN ↗
    The only part of "hard to read" that has ever made sense is that the callback takes multiple args and sometimes I can't remember the order of the initial value versus the accumulator.

    Incidentally, reduce is also powerful enough to implement both map and filter in terms of itself, though that's more of a teaching exercise than a good recommendation.

    I mostly interpret it as of the same spirit with those who oppose proper tail calls because it "ruins" their debugging stack traces.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.