Ask HN: Functional vs. Imperative Implementation of Algorithms
But nowadays most languages are mixed paradigm. Still there are differences.
Functional people give arguments like:
1. Code is easy to reason about
2. Can be verified easily and less prone to errors
3. Use mutation only when necessary, not as a default.
Imperative people say:
1. More efficient as close to the machine
2. More space efficient hence faster. (although functional languages can be as fast with compiler optimisations)
Functional languages are used in industry now at large scale e.g: Jane Street, Twitter, etc. Imperative language has always been used in industries. I bring up industries because it proves that the languages are scalable.
Functional programming experts say that their code is efficient because the compiler translates it to an efficient representation on the CPU. They have TCO and other things. But they don't mutate data and hence every function call creates a new data in memory taking up space. How do they overcome that?
Also we can switch between imperative and functional implementations. Basically an algorithm can be implemented eitherwise.
Now my question is where do I learn about these nitty gritty's? Should I read about compilers more? Or systems? Or what?
Can you suggest books/blogs/courses?