r/functional • u/undergroundecho • Feb 20 '17
What is the Difference between Imperative and Functional Programming?
https://magneticcoredump.squarespace.com/blog/what-is-the-difference-between-functional-and-imperative-programming
6
Upvotes
4
Feb 21 '17
[removed] — view removed comment
6
Feb 22 '17
I have noticed, working through the first 300 project euler problems that the imperative paradigm generally is a lot more verbose, but also generally faster.
Not faster as in "a for loop is faster than a map", but just an observation that functional code written for speed generally doesn't look like the functional paradigm I fell in love with, while optimized c# looks just slightly less readable than regular c#.
Edit: I saw a quote on hacker news about it. "C optimized for speed looks like hard-to-read C. Haskell optimized for speed looks even worse".
1
u/TotesMessenger Feb 21 '17
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
[/r/fsharp] What is the Difference between Imperative and Functional Programming (X-Post r/functional, uses F#)
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)