3 ms·
I was looking for that kind of answers,can you elaborate more, with some practical examples, on the rewards someone can get from "mastering" a pure-functional l
by ned7 7y ago
I was looking for that kind of answers,can you elaborate more, with some practical examples, on the rewards someone can get from "mastering" a pure-functional language?
- jstewartmobile 7y agoSome solutions are easier to express recursively than iteratively--especially in the graph/tree space. Filesystem? Tree. XML/JSON? Tree. Relational database? Graph w/ underlying tree implementation. State machine? Graph. As for immutability, consider how in languages like javascript, some mental accounting has to take place over what is passed by reference, and what is passed by value. Any error in this accounting can cause big problems. A pure-functional approach really cuts that problem down to size. New values are returned, and parameters are unchanged.