I try to avoid this site being purely a link-dump (although my last post would contradict), but I have to say that Tony Morris’ latest functional post is exceptional. In just a few paragraphs he manages to elucidate the benefits of functional programming in a way that I have never been able to approach. It’s so good, I’m going to quote it in it’s entirety:
Why Functional Programming Matters paraphrased — a result of a discussion in an IRC channel. Others may find value.
A program may be represented as a function that accepts some input and produces some outputλ This function may be composed of parts; other functions and values. Suppose any function that exists. I will suppose one that is made of parts A, B, C and D. I might denote this A ∘ B ∘ C ∘ D. Now suppose you desire a function that is made of parts A, B, C and E. Then the effort required for your function should be proportional to the effort required for E alone.
The closer you are to achieving this objective for any function, the closer you are to the essence of (pure) functional programming. This exists independently of the programming language, though programming languages will vary significantly in the degree to which they accommodate this objective.
Imperative programming — specifically the scope of a destructive update — is the anti-thesis of this objective.