I don't think OOP is hard to get right if you only use it for the problems that are shaped like OOP.
Peter Aaser
@PeterAaser
true
Ichoran
@Ichoran
I guess it doesn't help that OOP's sweet spot is really small compared to what it was billed as (solution to everything)
Rob Norris
@tpolecat
Agree, as long as we can disagree about how big the spot it.
Ichoran
@Ichoran
I suspect you think that the spot is the empty set, or perhaps the definition of OOP data structures. ("OOP data structures are a great way to model OOP data structures!")
Peter Aaser
@PeterAaser
I think we can all agree on disagreeing
Ichoran
@Ichoran
Anyway, I find OOP great for trees of ever-increasing but not-substantially-changing functionality, and/or elaboration of a basic operation with specialization on different types of data.
I find it lousy for plugging in new functionality, not earlier conceived, to relevant parts of an existing design.
Rewiring an entire inter-method dependency graph in a subclass is entirely possible, and terrifying. I can't even get that right the first time I write it, much less when maintaining it.
Marcin Sokrates
@marcinsokrates_twitter
I can't get over how akka-http is so extensible... they had to write a whole separate event loop for unix sockets to support them
Josh
@joshlemer
I find it confusing when doing things like, subclass calls super.foo() which calls this.bar() which is itself overridden in the subclass, that gets confusing
Ichoran
@Ichoran
Yeah, but that's how it's supposed to work. As long as you don't rewire your dependency graph, it's cool.
Basically you need strict LSP but also every dependency of method a on b has to be treated as part of the interface. Then things might "get confusing", but they generally work.
The whole point is that in the superclass, whether it's calling its own bar or the subclass bar is irrelevant insofar as the superclass can observe.
It is, admittedly, a little too easy to muck it up and make it matter.
But hey, it's easy to muck up recursion and make it infinite, and we still use recursion :)