As I was discussing this with my partner we summarised this as:
Humans have always had the capacity for violence and murder; as populations grew, acts of violence could be larger, both in terms of number of combatants and also length of time of continuous fighting. This is a progression of:
- Small bands of people skirmishing with neighbours to
- Towns sending small raiding bands to
- Cities fielding an army for a summer campaign to
- Empires furnishing professional armies and sending them on multi-year campaigns, to
- Nation states using advanced logistics to maintain millions of soldiers in the field for years at a time.
Somewhere between city-states and full modern nation states, there have been full on campaigns of genocide. But genocide can be thought here definitionally as only possible with some significant number of people.
Unfortunately there is a deep dark part of the human psyche that has always been with us.
I don’t think that the anti-oop collective is attacking polymorphism or overloading - both are important in functional programming. And let’s add encapsulation and implementation hiding to this list.
The argument is that OOP makes the wrong abstractions. Inheritance (as OOP models it) is quite rare on business entities. The other major example cited is that an algorithm written in the OOP style ends up distributing its code across the different classes, and therefore
Instead of this, the functional programmer says, you should write the algorithm as a function (or several functions) in one place, so it’s the function that walks the object structure. The navigation is done using tools like
apply
ormap
rather than a loop in a method on the parent instance.A key insight in this approach is that the way an algorithm walks the data structure is the responsibility of the algorithm rather than a responsibility that is shared across many classes and subclasses.
In general, I think this is a valid point - when you are writing algorithms over the whole dataset. OOP does have some counterpoints encapsulating behaviour on just that object for example validating the object’s private members, or data processing for that object and its immediate children or peers.