DEV Community

Calin Baenen
Calin Baenen

Posted on

Which one is better? OOP or FL?

I personally think OOP is better because it can do everything FP can, but with classes, and well, more OOP features.

Top comments (8)

Collapse
 
_hs_ profile image
HS

This has been "discussed" too many timss.

Collapse
 
baenencalin profile image
Calin Baenen

So? Then what's your verdict, ${pronoun based title like Ms. Mr., etc.} it's been discussed before.

I'd love to hear your opinion (which was kind of the point of the post).

Collapse
 
_hs_ profile image
HS

Well to be fair and reply I like data immutability but not service and others. Why write monoids, monads, or whatever it is when you can simply have state. But I did mark post as low quality because it was repeated too many times and not all people respect the "healthy" part about debate.

Thread Thread
 
baenencalin profile image
Calin Baenen

I'm sorry you reported my post as low quality (and I'd appreciate a return on that) as it's not low quality. I'm sorry I didn't realize that it's been talked about. But I've only found OOP vs FP, and they usually are either biased, or talk about them, expecting the reader not to know either.

I hope you consider un-reporting it, or revoking your report.

Thanks.
Cheers.

Thread Thread
 
_hs_ profile image
HS

As stated FP vs OOP vas debated many times here with good quality comments but all discussions contain biased ones also. Low quality means it has been either discussed many times, or the exact same topic of the post was written too many times or so. What's not low quality on this one? Because you added "healthy"? That's not how people work sadly, they will start exact same fights again.

But regardless, it's not a report it's more of a score. So, sorry but given that this discussion was done many times it's getting pushed a bit down so other topics that were not touched too many times can kick in.
Hope you understand,
Thanks

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Why not both? Also, FP can avoid many errors.

Collapse
 
baenencalin profile image
Calin Baenen

So can OOP, as long as you take the same functional approach. Right?

From what I've seen, if you're playing your cards right, you can do all of what you want in FP in OOP.
Is this not correct?

Also, why not both? I just wanted to contrast them, and define them separately, since one is possible in the other, but not vice versa.

Collapse
 
sunisstillhigh profile image
Daniel Ivanov

You should read about nest.js. This framework mix oop, fp and rfp (reactive-functional programming).