Theme 1 – Reduce is often unnecessary and less performant
Many commenters argue that built‑ins like sum, min, max, list comprehensions, or itertools are clearer, faster, and avoid extra imports.
- theamk: "At least in Python, I've found that 'reduce' is very rarely needed. Most of the times, 'sum' is enough, sometimes with 'start' values customized..."
- theamk: "If you are multiplying, you are likely doing heavy math, and you'll be using numpy – which does not need reduce either."
- Pinus (referring to the notorious slowness of sum(..., [])): "Has the performance of sum on lists of lists in Python been fixed? It used to be pretty abysmal."
Theme 2 – Reduce adds mental overhead and can be confusing
The need to supply an identity/zero value and to reason about intermediate, global state makes reduce harder to read than more local operations.
- evnix: "The name itself is confusing to begin with."
- snackbroken: "Map and Filter are nice because they let you reason locally about a single element in isolation. Reduce(Fold) forces you to reason globally about intermediate results. Reduce also forces you to conjure up a 'zero' value of the relevant type, which isn't usually difficult but it does constitute some extra mental overhead."
- chubot (referring to Guido’s Python‑2 reduce removal): "reduce() basically forces the inefficient implementation… O(n²) when s_i are strings."
Theme 3 – Reduce/fold is a valuable functional primitive when used appropriately
In functional settings or for specialized tasks (named‑dimension reductions, map‑reduce, folding), reduce is praised for its power and elegance.
- japgolly: "fold is awesome and super useful. It's the easiest and most convenient way to turn a collection into a single value."
- rsfern: "For numerical code I like einops.reduce more than numpy/pytorch sum reductions because you can reduce over named dimensions. It’s much more readable than having to reason through axis indexing again."
- karmakaze: "It's part of the functional trio: map, filter, reduce--and half of MapReduce."