‹ BackHN Continuity

Thread

Anecdotally, programmers dislike "reduce"

175 points · 283 comments · vinhnx

  1. skybrian · · focus · HN ↗
    It would be clearer if the operation were part of the name. The most common operations have good names, like sum(), product(), concat(), and so on.

    If there's no standard function for it, it's trivial to write a utility function.

    And as part of writing the function, give it a good name and think a bit about the order of operations?

    So I think reduce() is just unnecessarily generic, unless it's part of a more complicated system like running a map-reduce.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.