DEV Community

Discussion on: The two universes of programming! OOP and FP!

Collapse
 
scilari profile image
Ilari Vallivaara • Edited

Where do you get that FP could not use objects? For example, even Haskell has objects; an (immutable) class is one (good) way to define a data structure or a mathematical object, such as a complex number. These are perfectly usable by pure functions and FP in general.

I think this post kind of misses the point of these two paradigms by treating them as opposite and non-overlapping sides of programming. This is mainly due to not recognizing the key aspects of OOP and FP. Why isn't FP compared to imperative programming and OOP to something that does not bundle the functionality and data, instead?

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him) • Edited

Hi
Thanks for your comment
I know that OOP and FP can have many things in common. I just wanted to give a general idea about these two and the general thing about FP is that they don't use classes and objects. I will try to write an article more detailed about imperative and declarative programming later.