Fabio Manganiello on Nostr: IMHO most of the criticism against OO is unfounded. Organizing your code into ...
IMHO most of the criticism against OO is unfounded. Organizing your code into components with their own methods and leveraging inheritance, polymorphism etc. is actually something very useful.
Problems arise when:<li><p>Domain boundaries are not properly drawn, so you end up with objects that are collections of a bit of everything - I’ve seen plenty of classes that are supposed to only model objects but eventually end up also implementing serialization, relational storage, interaction with Kafka streams, and maybe also some logic to make your coffee.</p></li><li><p>The Java approach is applied to the letter. I put my blame on Java because it created a generation of developers forged in dogmas such as “everything must be a class, and every file must contain exactly one class”. You then end up with things that are conceptually supposed to be functions, or compositions of functions, being squeezed into unholy constructs such as factories, builders, adapters, builders of factories, adapters of builders, through infinite layers of abstraction that only benefited a few authors of fat design pattern books in the 2010s, just because everything must be an object that you need to label in some way.</p></li>
Problems arise when:<li><p>Domain boundaries are not properly drawn, so you end up with objects that are collections of a bit of everything - I’ve seen plenty of classes that are supposed to only model objects but eventually end up also implementing serialization, relational storage, interaction with Kafka streams, and maybe also some logic to make your coffee.</p></li><li><p>The Java approach is applied to the letter. I put my blame on Java because it created a generation of developers forged in dogmas such as “everything must be a class, and every file must contain exactly one class”. You then end up with things that are conceptually supposed to be functions, or compositions of functions, being squeezed into unholy constructs such as factories, builders, adapters, builders of factories, adapters of builders, through infinite layers of abstraction that only benefited a few authors of fat design pattern books in the 2010s, just because everything must be an object that you need to label in some way.</p></li>