Continuing the discussion from Beautiful functional programming:
@tomjaguarpaw asks the question why people think imperative code is worse than functional code. I think that is an interesting discussion topic.
First of all, I personally wouldn’t really say functional, but instead denotative.
My inspiration for striving for denotative code comes from the podcast and ZuriHac presentation of @conal. He can explain it much better than me in a short discourse post:
Some memorable points that resonated with me are (paraphrased):
-
The Von Neumann bottleneck is about more than just the bottleneck between the CPU and RAM, the more important bottleneck is that it limits our thinking about computation.
-
The real world is not sequential, it is massively parallel. Even modern computers themselves have had to admit parallelism and now have to try very hard to pretend to be sequential.
-
There is no large and small in thought, so approaches that do different things at different “levels” won’t stand the test of time. For example: “functional core, imperative shell”.
Of course many programmers have to write practical programs and write them now. And the theory of computation is currently not well-developed enough to give definitive answers for many practical problems. However, I think we should also keep thinking about what future we are heading towards.
I’m sure there are people who disagree with this point of view, so I’d love to hear your thoughts.