Anecdotally, programmers dislike "reduce"
Anecdotally, programmers appear to have a preference for certain higher-order functions over others. While they frequently utilize functions like map and filter, they seem to have a lesser liking for reduce. The author, who relies on map and filter extensively in their work, has rarely encountered feedback regarding their usage of these functions during code reviews. However, this is not the case with reduce.
When submitting patches containing reduce, the author frequently receives comments such as, "this part is hard to read." Their observations suggest that reduce is used less frequently compared to functions like map, filter, and some. Despite preferring alternative approaches, the author acknowledges that switching reduce to another function is a relatively simple solution.
The author posits a few theories to explain this observed phenomenon. One possibility is that reduce is simply less popular among programmers. Another hypothesis is that the current trend of less thorough code reviews may have contributed to the decreased prevalence of reduce.
The author is curious to know if others share their observations, and if they prefer reduce or find it less appealing. They invite feedback from others in the programming community to further understand this social phenomenon.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.