<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck" -->

---
title: Anecdotally, programmers dislike "reduce" | daily.dev
description: Reflecting on years of code review experience, the author observes that programmers rarely complain about map and filter but frequently flag reduce as hard to...
canonical: https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Anecdotally, programmers dislike "reduce" | daily.dev
og:description: Reflecting on years of code review experience, the author observes that programmers rarely complain about map and filter but frequently flag reduce as hard to...
og:url: https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck
og:image: https://api.daily.dev/og/posts/0jyDxJgCK.png
og:image:alt: Anecdotally, programmers dislike "reduce"
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Anecdotally, programmers dislike "reduce"

**[Lobsters](https://daily.dev/sources/lobsters)** · 2 min read · 0 upvotes · 1 comments

## Summary

Reflecting on years of code review experience, the author observes that programmers rarely complain about map and filter but frequently flag reduce as hard to read. Several theories are floated for why reduce gets this reputation: it's less familiar, can be less performant, and feels less elegant in languages like JavaScript, Python, and Swift compared to Clojure. The author usually just rewrites reduce into something else rather than defend it, and notes the pattern seems less pronounced lately, possibly due to less thorough code review.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://evanhahn.com/posts/2026-09-13-programmers-dislike-reduce>

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 45 comments across lobsters (as of 2026-09-14).

**TL;DR:** Discussion largely agrees reduce genuinely reads as harder than map/filter, tracing this to its excessive generality, inconsistent zero/one-element semantics, poor naming, and higher working-memory cost, though several argue it's a learnable skill issue rather than a real flaw.

**Sentiment:** 25% positive · 45% mixed · 30% skeptical

**The case for**

- Fold/reduce is theoretically the universal abstraction from which map and filter can be derived, showing its power and elegance.
- Some find well-written folds easier to comprehend than bare loops once the pattern is internalized.
- In array-language traditions like APL/K, reduce is a natural first construct, especially paired with scan for tracing intermediate results.

**The pushback**

- Reduce's generality means it narrows the space of what the code could be doing far less than map/filter, making it harder to read at a glance.
- Argument order, accumulator position, and left/right-fold semantics differ across languages and even within a single call, imposing a real working-memory tax.
- Clojure's reduce has confusing, inconsistent behavior for empty/singleton collections that even its own creator has called one of the worst design choices copied from Common Lisp.
- Reduce is rarer in practice than loops or map/filter, so pattern recognition for it is weaker among most developers.
- A named for-loop or a dedicated function (sum, flatMap, etc.) is often more readable and can even reveal bugs that a reduce implementation was masking.

**By community**

- lobsters (mixed): Extensive, technical thread debating whether reduce's unreadability stems from its raw expressive power, poor naming/argument conventions, or just unfamiliarity, with many personal anecdotes of pushing colleagues away from it alongside some strong defenders.

**Hottest debate:** Whether reduce's reputation is an inherent flaw of the abstraction (too powerful/inconsistent semantics) or simply a 'skill issue' from insufficient exposure and practice.

**Open questions**

- What would an ideal reduce/fold API look like that avoids the empty-collection/singleton semantic inconsistencies?
- Is there a good alternative name that would meaningfully reduce confusion (accumulate, inject, fold, aggregate all have tradeoffs)?
- Why do so few languages that offer reduce also offer scan, and would wider availability of scan change how reduce is perceived?

**Highlights**

> Rich agrees with you. Emphasis mine: >Who knows what the semantics of reduce are when you call it with a collection and no initial value? >[Audience response] >No one, right. No one knows. It's a ridiculous, complex rule. **It's one of the worst things I ever copied from Common Lisp was definitely the semantics of `reduce`.** It's very complex. If there's nothing, it does one thing. If there's one thing, it does a different thing. If there's more than one thing, it does another thing. It's much more straightforward to have it be monoidal and just use f to create the initial value. That's what transduce does, so transduce says, "If you don't supply me any information, f with no arguments better give me an initial value." >Note though, there's no requirement that you support that. You don't have to have that arity. You don't have to allow people to call transduce with no initial value because sometimes there's just no good made up from nothing initial value. Somebody needs to think about an initial value or supply some inputs to your process to get a starting value. Not everything can be made from nothing. It's easy to come up with zero from nothing. But it's not easy to come up with a channel from nothing or other kinds of things, you know, event systems. You don't have to support this. From [Inside Transducers (2014)](https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/InsideTransducers.md).
> — [daveliepmann on lobsters · 1 points, 1 comments](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce#c_88aalq)

> Caveat: My experience is mostly Haskell and while I'm sympathetic to lisps, I've done very little with them. I find the contract for `clojure.core.reduce` rather difficult to follow: * If you call `reduce` with two args, it behaves kinda like `foldl1 f coll`:   * It computes `(f (f x1 x2) x3)` etc., with the first elements of the collection being in the first applications to `f`.   * If you call it on an empty collection, you get `(f)`. (My read is that the library author tried to make `reduce` total when used in two-arg form, when IMHO it's really a precondition violation. I feel raising an error would be more appropriate.)   * If you call it on a singleton collection, you get that value back and `f` is never called. * If you call `reduce` with three args, it behaves kinda like `foldl f val coll`:   * It computes `(((f val x1) x2) x3)` etc. As with the two-arg form, earlier elements are applied first.   * If you call reduce on an empty collection, it returns `val`. The thing that seems most surprising a that `(reduce f z [1])` is `(f z 1)` but `(reduce f [1])` is `1`; and that `(reduce f [])` is `(f)` but `(reduce f z [])` is `z`. The reader is forced to care about boundary conditions much more than when using `map` and `filter`. It's clear why after you think about what each form of `reduce` is doing, but I personally would have distinguished between possibly-empty and definitely-non-empty collections and provided `reduce` and `reduce1` functions in the stdlib.
> — [jackdk on lobsters · 2 points, 1 comments](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce#c_wyzaaj)

> On top of being too powerful, I think the ergonomic tax on [working memory](https://en.wikipedia.org/wiki/Working_memory) is too high. Every language has its own operand order and function syntax, so now when writing your reduce, you have to consider:  - Is this a right fold or a left fold? Does it matter?  - Is the first argument the base accumulator or the reducer function?  - In the reducer function, which argument comes first, the element or the accumulator? That's already a couple slots of working memory that need eviction in order to write the fold. What gets evicted is probably the domain logic that we're trying to express in the fold. It doesn't help that every language has a slightly different take on the above questions.
> — [pzel on lobsters · 1 points](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce#c_am4ptw)

> I once had a manager who loved to use reduce, and every single code review I would ask him to change it, until I finally broke him of the habit. My primary complaint is that it (typically) saves like 3 lines of code but also makes the code much less readable and harder to reason about. That's a bad tradeoff! (I finally convinced the aforementioned boss when I reviewed a PR and found a bug that was disguised by reduce but that would have been obvious if he'd just used a for loop.)
> — [joelgrus on lobsters · 1 points](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce#c_vl7yxa)

> > `reduce` is less elegant in languages I use, like JavaScript, Python, and Swift. Anecdote from Python-land: `reduce` used to be a built-in function in Python 2, but in Python 3 it was relegated to `functools`. [Why Guido decided to demote it](https://www.artima.com/weblogs/viewpost.jsp?thread=98196): > This is actually the one I've always hated most, because, apart from a few examples involving + or \*, almost every time I see a reduce() call with a non-trivial function argument, I need to grab pen and paper to diagram what's actually being fed into that function before I understand what the reduce() is supposed to do. So in my mind, the applicability of reduce() is pretty much limited to associative operators, and in all other cases it's better to write out the accumulation loop explicitly. So Evan is not alone in noticing this! Contrast with `map`/`filter`, whose Pythonic equivalent is comprehensions. Anecdotally, those seem to spark joy more often. (I like them, at least.)
> — [bitshift on lobsters · 3 points, 1 comments](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce#c_w2o7kt)

**Source threads**

- [lobsters](https://lobste.rs/s/dhn991/anecdotally_programmers_dislike_reduce) · 45 points · 45 comments

## Community discussion

Top comments from developers on daily.dev.

**@nark3d** · 0 upvotes

> I agree that reduce gets a bad reputation it mostly doesn't deserve.  I've seen complainers usually reacting to a version that's doing three jobs at once, and rewriting it into a for loop hides that rather than fixing it.  Splitting the accumulator into its own named step got the review complaint to go away without changing the shape.  A reviewer usually has two lines of setup and one line of reduce left, and nobody objects to that.

## Similar posts on daily.dev

- [Laurence Tratt: Test-case Reducers Are Underappreciated Debugging Tools](https://daily.dev/posts/laurence-tratt-test-case-reducers-are-underappreciated-debugging-tools-hr6ulgmq3) · Lobsters · 0 upvotes · 0 comments
- [Designing real systems with immutable data in Clojure](https://daily.dev/posts/designing-real-systems-with-immutable-data-in-clojure-wdvqc5itp) · Nubank · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#code-review](https://daily.dev/tags/code-review), [#functional-programming](https://daily.dev/tags/functional-programming)

[View this post on daily.dev](https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Anecdotally, programmers dislike \"reduce\"","url":"https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck"},"datePublished":"2026-09-14T03:18:13.350Z","dateModified":"2026-09-14T11:04:16.641Z","description":"Reflecting on years of code review experience, the author observes that programmers rarely complain about map and filter but frequently flag reduce as hard to...","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"javascript,code-review,functional-programming","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"Anecdotally, programmers dislike \"reduce\""}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/anecdotally-programmers-dislike-reduce--0jydxjgck","comment":[{"@type":"Comment","text":"I agree that reduce gets a bad reputation it mostly doesn’t deserve.  I’ve seen complainers usually reacting to a version that’s doing three jobs at once, and rewriting it into a for loop hides that rather than fixing it.  Splitting the accumulator into its own named step got the review complaint to go away without changing the shape.  A reviewer usually has two lines of setup and one line of reduce left, and nobody objects to that.","datePublished":"2026-09-22T16:23:58.379Z","url":"https://daily.dev/posts/0jyDxJgCK#c-aNgVjKLa6","author":{"@type":"Person","name":"Adam","url":"https://daily.dev/nark3d","image":"https://avatars.githubusercontent.com/u/2162621?v=4"}}]}
```

