7 ms·
"In Clojure this is fairly straightforward" Somehow when things get complex, I could never find fully functional style to be more understandable than imperativ
by adelks 10d ago
"In Clojure this is fairly straightforward"
Somehow when things get complex, I could never find fully functional style to be more understandable than imperative
- MathMonkeyMan 10d agoMaybe part of it is that fully functional notation necessarily preserves certain properties of the computation, while imperative style doesn't have to. For a complex piece of code, all of the hairiness is manifest in a functional style, but can be made implicit in an imperative style. So there's an economy to the imperative approach as things get complex, but in a sense we're just laundering the complexity from understanding the machinations of the code to understanding the correctness of the code.
- dTal 9d agoHence, objects; keep alternating between functional (stateless) and imperative (stateful) as you ascend the abstraction tower, so that the hairiness does not leak between layers and hence accumulate.