News for hackers. Stuff that matters.
Re:Functional Programming – How and Why by sideeffffect on Monday January 02, 2023 @08:01AM (#34217423)
Then it really depends what exactly you mean by OOP. Some people use the OOP features for modularity and structuring of the codebase, without any side effects/unmanaged mutation. Often they don't call it "OOP" then, but rather "a module system". But there isn't any theoretical distinction.

For example, I do _both_ Pure Functional Programming _and_ OOP (in the "module system" way) in Scala daily. And it works very nice IMHO, I encourage everybody to give it a try.

Use traits as interfaces for logical pieces of your business logic. Implement them in (case) classes which receive interfaces to other pieces of logic in their class constructor. Use a so called "Functional Effect System" like Cats Effect or ZIO to avoid raw side effects. And that's it, enjoy and profit.

Re:Functional Programming – How and Why by jstimpfle on Monday January 02, 2023 @08:10AM (#34217484)
It's impossible to get people to agree on what OOP is exactly, but almost everyone agrees that hiding/isolating mutable state (inside objects) is an essential part of it. Just google "what are objects in programming".
Re:Functional Programming – How and Why by sideeffffect on Monday January 02, 2023 @08:32AM (#34217626)
Totally agree that these paradigms are badly defined. See my other comment where I explain it more https://news.ycombinator.com/item?id=34217547

My point here was that all "OOP" languages (that I know) allow you, with all their "OOP feautres", to work with objects which actually don't contain any mutable state.

I'll let you be the judge whether it is still "OOP", but I know from experience that it's very practical for Software Engineering.