‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. _moof · · focus · HN ↗
    What's hard to understand about it? It's just

      x = initial
      for y in collection:
        x = f(y, x)
    1. Joker_vD · · focus · HN ↗
      You mean "f(x, y)", right? Half of the languages that have reduce/fold use this ordering, another half uses yours.

      So in effect, as some other commenter said, it's just the loop with worse syntax.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.