logoalt Hacker News

adelksyesterday at 5:03 PM1 replyview on HN

"In Clojure this is fairly straightforward"

Somehow when things get complex, I could never find fully functional style to be more understandable than imperative


Replies

MathMonkeyManyesterday at 9:56 PM

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.

show 1 reply