3 ms·
My observation (and, I believe the authors of How to Design Programs have some data about this) is that FP is only “hard to learn” if you already know how to pr
by fiddlerwoaroof 5y ago
My observation (and, I believe the authors of How to Design Programs have some data about this) is that FP is only “hard to learn” if you already know how to program: you have to unlearn things like “for loops” and various techniques that rely on mutation and learn to think in terms of the abstractions FP provides you.
- 8fGTBjZxBcHq 5y agoSo the biggest barrier that I found when learning ocaml was there were just not a lot of resources or organic examples around. What there is is usually for a specific course, or is published by like Jane Street or some shit and highly domain-specific as well. I just found it hard to dig myself out when I ran into trouble. I definitely agree about the FP concepts being no more difficult or even simpler to learn. I used to teach introductory programming to adults and at first we taught loops then map/filter etc and told students to use their preference. Almost universally they used map, including complete synthesis of the entire concept of iteration without loops. Like when presented with a loop, I once saw a student skim the internal logic, see that it was doing an array push inside an if, and call it "a filter loop." To him the filter was the concept and the loop the tool, which is I think backwards from a lot of us.