|
|
|
|
|
by ChrisRus
2292 days ago
|
|
OOP is not a helpful paradigm for modeling systems. If it was, we would design digital circuits with classes. But, of course that's not possible. Because classes are absolutely a horrible metaphor for representing shared state at runtime. And, that's most of what modern systems are doing. Have you ever stopped to consider that a class API is effectively the pin-out to a chip that's missing it's observable state vs input specification? Nobody would use that chip because it's actually not adequately documented. And, so why people think OOP is still a reasonable basis for building re-usable code and expressing ideas about system architecture after decades of disappointment is one of software enduring mysteries. My speculation is that the half-life of talented engineers before they become managers is approximately equal to the number of years you need to seriously struggle with OOP before you have enough perspective to start having ideas of your own. And, then you switch to management, and buy a book on design patterns, and kick the can to the next generation. |
|
What was originally conceived as message passing[1] is actually implemented by OO languages as passing around pointers to objects that have mutable state, so in effect, every object is potentially part of global shared state.
Inheritance is a confused mess of "is-a" semantics, type system behavior, and code/state sharing in a set of subclasses.
I'm often somewhat amazed that we can build working large-scale systems at all in these languages given their weaknesses and the knowledge/skill level of the average programmer.
One source for what OOP was meant to be is https://wiki.c2.com/?AlanKaysDefinitionOfObjectOriented. That article links to others, and you can follow quite a rabbit trail of "what OOP is" threads.