logoalt Hacker News

MathMonkeyManyesterday at 9:56 PM1 replyview on HN

Maybe 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.


Replies

dTaltoday at 7:30 AM

Hence, 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.