DEV Community


Discussion on: Functional VS Object-Oriented Programming

olvnikon profile image

I would also mention that FP encourages to handle "null" and exceptions in a different way using Maybe (or Option) and Either monads. The concept is called "Railway programming".

FP encourages lazy calculations. For example, IO monad doesn't run the effect until the very last moment. The same with Future (FP Promises).

FP has a different approach for reusing the code. For example, lenses can be applied on any object. Atomic functions can be composed and used to map data.

There are more differences but these came up in my mind besides things that were mentioned in the article and in the comments.