4 ms·
Beginners are most concerned with composition and style. Syntax is easy because when you get it wrong everything is broke. After that everything is a matter of
by austincheney 5y ago
Beginners are most concerned with composition and style. Syntax is easy because when you get it wrong everything is broke. After that everything is a matter of how to put things together. It’s like playing with legos and needing the instruction manual.
Knowing that instead reverse the problem. Instead of teaching putting things together try instruction from tearing things apart. The goal being circumventing composition and replacing that with thinking about the solution, the end state. Composition, the thing beginners so fixate on, will come out about incidentally.
As for FP specifically there are two approaches people seem to think about: return value and structure. In teaching from return value the focus is upon input/output and control flow whether from chaining or nesting function calls as this tends to be more declarative. Teaching from the perspective of structure focuses more on scope, call order, and asynchronous states which tends to be more imperative. Let a given problem dictate the specifics of the FP execution.
As for specific languages Clojure is really popular in this area with an emphasis on conciseness. Haskell is syntax heavy but is the elder statesmen of FP languages. I prefer TypeScript myself, but is probably far less ideal for teaching these concepts.