DEV Community

Discussion on: Ending the war or continuing it? Let's bring functional programming to OOP codebases

Collapse
 
maxgoldst profile image
Max Goldstein

I think this is a great summary for someone new to the topic.

Here's another perspective. Functional programming is about programming with pure functions, like ones in math, it's right there in the name. So why is it also about immutability? Because if you could mutably rebind a name from one function to another, it would no longer look like a pure function. And mathematical functions don't mutate anything: running lcm(6, 10) doesn't change six or ten. Mutation is a side effect.