3 ms·
I never bought into the pure functional programming hype. Most programs are made up of many functions and as the program gets more complex, the code paths keep
by jondubois 9y ago
I never bought into the pure functional programming hype. Most programs are made up of many functions and as the program gets more complex, the code paths keep getting longer... If you force everything to always be passed by value and returned by value (never by reference) it's clear that the costs of constantly cloning all these objects would quickly add up.
The problem with pure functional programming is that it prevents the developer from writing well optimized code.
State change side effects might be dangerous, but they're also a really good way to boost performance and sometimes they're totally worth it.
- ramchip 9y ago> If you force everything to always be passed by value and returned by value (never by reference) it's clear that the costs of constantly cloning all these objects would quickly add up. That’s not what happens. See: http://erlang.org/pipermail/erlang-questions/2013-March/072760.html http://erlang.org/pipermail/erlang-questions/2013-March/0727... “Pass by value does NOT imply copying and never has; copying is only required for mutable data structures, and Erlang hasn't any.”
- cutler 9y agoSee Rich Hickey's description of structural sharing in Clojure. Persistent data structures are not simple copies.