4 ms·
DB operations are not what is being described in the conversation about referential transparency. We’re talking about something that starts with things like re
by ARandomerDude 4y ago
DB operations are not what is being described in the conversation about referential transparency.
We’re talking about something that starts with things like reduce vs. a for loop with mutable variables to accumulate values. Once the language forces you to think in terms of stateful operations to perform even basic tasks, the reflexive tendency is to use mutable state to perform any task. At that point, nobody really knows what a functional does because you have to understand the entire system to know what the output of a function will be.
- vc8f6vVV 4y agoBut we do have loops in the real world, don't we? So in a true FP we are talking about recursion as an alternative to for loops. Can you easily reduce recursive function? If you can, I can as well "reduce" for loop. Otherwise we are talking about a paradigm without recursions and side effects.
- ARandomerDude 4y agohttps://clojuredocs.org/clojure.core/reduce https://clojuredocs.org/clojure.core/reduce