3 ms·
You nailed it. Object programming was never about the low-level details like inheritance; it was always about managing state and sharing behavior (just like fun
by trashburger 3y ago
You nailed it. Object programming was never about the low-level details like inheritance; it was always about managing state and sharing behavior (just like function programming!). Object programming looks at things from the perspective of the object; each object has some state and some behavior it can respond to when sent messages. Objects with compatible behavior can be substituted for each other (this is the essence of behaviorism[0]). This is symmetrical to function programming's pattern matching where values with compatible structure can be substituted as arguments to a function (this is also why I firmly hold the belief that Lisp and Smalltalk are symmetrical languages). Languages like Haskell even use things like "Integer a =>" which are basically object programming interfaces!
[0]: https://handbook.selflanguage.org/2017.1/progguid.html#behaviorism-versus-reflection https://handbook.selflanguage.org/2017.1/progguid.html#behav...