In functional programming (FP), pure functions are the basic building blocks. In object-oriented programming (OOP), “objects” are the basic building blocks. Objects encapsulate data and functions. Pure functions and objects can both be reused and combined to build complex logic. My point is that FP and OOP may be regarded as opposite sides of the same coin:

Functional decomposition is no better nor worse than object decomposition for solving problems. The only thing that FP has as a distinguishing quality is data immutability, and even then not all FP languages have it (eg, JavaScript) nor strictly enforce it (eg, Lisp). (Yes, I’m aware JavaScript has a library for immutability, but that’s a lame workaround.)

I don’t want to discourage functional programming, but make sure you don’t oversell it: read Is Functional Programming overtaking the IT Industry?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store