DEV Community

Discussion on: Functional VS Object-Oriented Programming

Collapse
 
stereobooster profile image
stereobooster

This sounds a bit misleading.

Yes, currying is nice, but there is nothing magical about it. You can achieve the same with objects ¯\_(ツ)_/¯.

all the interesting things you can do with immutability and functional composition.

Immutability is not something that adds capabilities to the system it rather restricts capabilities (you don't have the mutation). It is a trade-off. Developer agrees not to mutate things (as the result they can worry less about some edge cases), but the same time you need more memory (not necessary much more) and new tools (for example, lenses). There is a middle ground, like local mutation allowed and global mutations prohibited, for example in Pony language.