[conspire] OOP

Nick Moffitt nick at zork.net
Sat Sep 26 04:43:36 PDT 2020


On 25Sep2020 11:09pm (+0200), Ivan Sergio Borgonovo wrote:
> Drupal started with a deep idiosyncrasy against OOP but starting with 8 it
> became crazy about all the buzzwords as dependency injection and what not.
> It's still full of legacy code that from my POV makes OOP techniques just a
> gimmick that often just get into the way.

It's important to note that we have only recently emerged from the 1990s fever-dream that OOP was all about building towering houses of cards out of multiple inheritance to model our systems.  There have been a lot of redefinitions of what "object-oriented" actually means over the years, but it was inevitable that there would be strong reactions against fin-de-siècle habits of class hierarchies and encapsulation of I/O deep in the bowels of many-layered objects.

We're now finishing off a decade where the folks at the forefront took a harder look at our coding models and re-discovered that composition can be less fragile than inheritance, and that I/O should be on the TOP of your call tree rather than the bottom.  It still *feels* so new a movement that I'm always surprised to remember that this screencast came out in 2012:

	https://www.destroyallsoftware.com/screencasts/catalog/functional-core-imperative-shell

...and that this talk (which is remarkably clear and well-delivered), is from 2014:

	https://www.youtube.com/watch?v=DJtef410XaM

I think it was justifiable in the 90s and 2000s to resist OO, partly because it was difficult to find an OO language that didn't actively work against this kind of architecture.  To do things in a more modern way, you would have had to ignore most of the standard libraries (many of which at the time insisted you subclass from them and overload methods to "finish" their classes) and implement everything from scratch.  It's obvious how it would seem far easier to just pick something not-OOP and go from there.

Of course, to emerge from this cave to immediately hail "dependency injection" as the technique you intend to take up suggests that perhaps you weren't paying attention.



More information about the conspire mailing list