3 ms·
As I get older, I realize that the functional/imperative debate is far from over. To say that functional code is "more intuitive" is not only off the point but,
by michaelochurch 14y ago
As I get older, I realize that the functional/imperative debate is far from over. To say that functional code is "more intuitive" is not only off the point but, I would argue, wrong.
Here's a reddit post I wrote about it a few months ago: http://www.reddit.com/r/programming/comments/14hhwa/program_imperatively_when_needed_and_functionally/c7d73tl http://www.reddit.com/r/programming/comments/14hhwa/program_...
Imperative code is much more intuitive in the small. That's why we lose when we make side-by-side code snippets of small toy programs and call it a case for FP. The 25-line imperative method is often more intuitive than the highly-dense 6-line functional one. The problem is that imperative code composes very poorly.
- vorg 14y ago> The 25-line imperative method is often more intuitive than the highly-dense 6-line functional one. The 25-line functional program will typically include a 6-line imperative one (with all that imperative code in one place if it's Haskell).
- runT1ME 14y ago>Imperative code is much more intuitive in the small. In a single threaded, deterministic environment yes. But when you're talking multithreaded, I'd disagree. if (user != null) user.company = getCompanyByName("google") being a NPE waiting to happen (in a multithreaded environment) is certainly non-intuitive.