Skip to content
HN On Hacker News ↗

Anecdotally, programmers dislike "reduce"

▲ 38 points • 1 comments • by praptak • 4w ago • HN discussion ↗

Pangram verdict · v3.3

We believe that this entire text is human-written.

0 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 218
PEAK AI % 0% · §1
Analyzed
Sep 16
backend: pangram/v3.3
Segments scanned
1 windows
avg 218 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 218 words · 1 segments analyzed

Human AI-generated
§1 Human · 0%

In short: from my experience, people like map and filter, but not reduce.I use functions like map and filter all the time. When I put that code up for review, my peers rarely complain. I get plenty of feedback about other decisions, but not about my use of map and filter.I cannot say the same for reduce. Often, when I’ve submitted a patch with reduce inside, I get a comment like, “this part is hard to read.” And I see reduce way less than map, filter, some, and so on.Anecdotally, I have come to believe that programmers don’t like reduce as much.I don’t know why, but I have a few theories:reduce is harder to read.reduce is less familiar.reduce can have worse performance compared to other options.reduce is less elegant in languages I use, like JavaScript, Python, and Swift. In my blissful stint as a Clojure developer, I did not get this feedback.I’m wrong, and I’m seeing a trend that’s not real.I usually just change reduce to something else and move on. Even though I prefer it, I don’t usually care much. But it’s a little social phenomenon I’ve observed, and I thought I’d document it.I’ve also noticed this less recently, possibly because code review is less thorough nowadays.Do you notice this? Do you like reduce? Please tell me.