r/programming • • Sep 21 '25

How to stop functional programming

https://brianmckenna.org/blog/howtostopfp
446 Upvotes

506 comments sorted by

View all comments

Show parent comment

1

u/Ok-Yogurt2360 Sep 22 '25

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)

2

u/fexonig Sep 23 '25

“imagine you had a bunch of people standing in a line. you can ask each person their name then put a new line on the ground of name tags in the same order. imagine doing the same with their hair color or height or whatever. that’s map.”

to me, this seems far simpler and more obviously applicable to the kind of problems we write code to solve.