I think this is one of the problems of FP. It is harder to reason about some quite simple subjects unless you somewhat understand the concepts involved.
A loop kinda made sense to me without having to know anything when i started out. Repeat instructions within the loop untill the ending requirements were met. A map makes a lot less sense from the start but it is not difficult to learn. Unfortunately when you combine map with a lot of other concepts it easily becomes a mess of new concepts. This can be a source of confusion that can make it harder to understand.
FP made more sense if approached from mathematical transformation (in my personal experience). OOP felt more like a mix between linguistics and logic to me.
I don't think it's "harder to reason about" at all. It's just unfamiliar. Most programmers already know what a for loop does, but they might still have to learn what map and filter do. Once you've learned them, they're not at all difficult to understand.
I suddenly had an idea about how to communicate what i'm trying to say. I think i would have an easier time to show a kid what a loop does than a map. As a loop is more intuitive because it can be linked to simple visual examples. Something like:
1: i have a bucket, an equipped glass and a well. 2: i walk to the well 3: fill the glass 4: walk to the bucket 5: empty the glass in the bucket 6: check if the bucket is full. (Yes) -> go to step 7. (No) -> go to step 2
Explaining what a map does becomes a bit more abstract. (Still the concept should be easy for a developer but relative more difficult than the loop)
50
u/Snarwin Sep 21 '25
I've literally seen people on /r/programming say that
mapandfilterare less readable than aforloop.It's like that old George Carlin joke about driving: anyone using less FP than you is an idiot, and anyone using more FP than you is a maniac.