
Ask HN: Is there a clear, mature discussion of OOP/functional tradeoffs? - westoncb
Since getting into web development I&#x27;ve found myself regularly in contact with folks who take it for granted that OOP as a paradigm has proven itself a failure (typically with the attendant viewpoint that functional programming has proven itself to be superior).<p>My current perception is that it&#x27;s primarily bandwagon mentality promoting the above viewpoint. For instance, I was reading an article purporting to explain what object-oriented programming &#x27;really&#x27; is, and they cited as part of their motivation for bringing this up the wildly popular &quot;Goodbye, Object Oriented Programming&quot;[0]; and while the first article was not what I would call a particularly deep discussion of the nature of OOP, the popular article it referenced (with 44k upvotes) was just laughably unsophisticated, uninformed, and rhetoric-laden. Every point he put forward had such a simplistic rebuttal that I had to wonder if he was intentionally setting up straw-men or just didn&#x27;t know better.<p>So now it&#x27;s on my mind: &quot;is this the sort of thing folks are reading which has given them the idea that OOP has been disproven as effective?&quot;<p>Now I feel motivated to take a close look at the issue if there is a serious, well-informed dissection of the efficacy of OOP for modern developers. It would especially be valuable if instead of vaguely referring to inadequacies it also pointed out how alternate paradigms more successfully deal with specific points.<p>My current suspicion is, regarding OOP vs. functional: both can be used well or poorly, so a lot of it just comes down to the developer&#x27;s ability to exploit their features—and the rest just depends on the domain you&#x27;re trying to model. For instance, if that domain deals with a bunch of things that look and interact like objects, then OOP will probably be better; if it&#x27;s mostly a complex, abstract computation, functional would be better.<p>[0] https:&#x2F;&#x2F;medium.com&#x2F;@cscalfani&#x2F;goodbye-object-oriented-programming-a59cda4c0e53
======
AnimalMuppet
Your last paragraph is pretty much where I stand. I'm not trying to fire a
shot in a language war. I'm not trying to build a perfectly-architected Gang
of Four masterpiece. I'm not trying to produce a mathematically beautiful
perfectly-stateless category-theoretic treatise. I'm just trying to write a
program that does something.

So I don't really care about FP ideology or OO ideology. I'll pick the tools
that best let me get my work done. If that offends purists, that's their
problem.

As to your actual question, a reasonable, unbiased discussion of tradeoffs...
sorry, no, I don't have one.

~~~
westoncb
Yeah, I think our thinking is pretty similar. I think OOP is very natural fit
for thinking about lots of things, and I think there are some great ideas that
have come out of the functional paradigm. I still prefer to use a language
that has OO organizational structures, but I definitely feel some pain if I
can't have first class functions. I also value the idea of functional purity
and whenever possible I'll write my functions so they're pure—but I don't
adhere super strictly unless in a part of the program that critically needs
it. Same with immutability.

------
petethomas
Maybe try this post, "Object Oriented Programming vs. Functional Programming"
by Bill Gathen dated May 12, 2015 [0]

[https://www.codenewbie.org/blogs/object-oriented-
programming...](https://www.codenewbie.org/blogs/object-oriented-programming-
vs-functional-programming)

[0]
[https://twitter.com/ryanbrush/status/999982149901021184](https://twitter.com/ryanbrush/status/999982149901021184)

------
auslegung
I was only introduced to FP 6 months ago, and I'm no expert on OOP either.
Functional Thinking by Neal Ford compares the two (of course it favors FP).
Should be a good piece to the puzzle, though, at least worth skimming it.

My opinion is that things like purity, immutability, type checking, and other
FP characteristics are incredibly helpful, and they make me write code with
fewer bugs.

