I’m jumping in late here, but I worry this thread is going off in the weeds. If one is helping to introduce an imperative programmer into Elixir and they ask “how do you handle for loops?” is it more helpful to show them that recursion can do everything imperative iteration can do, or jump immediately to higher order functions or for comprehensions? I see value in showing the recursive solution, but quickly moving over it into better abstractions. IMHO, if a functional programmer has not, at some point, implemented map and reduce with recursion, then they don’t really understand FP.
7 Likes






















