2 ms·
> OOP encapsulates data by default That ideas's been nagging at me lately. In his paper, The Early History of Smalltalk, Alan Kay wrote, "doing encapsulation r
by mumblemumble 6y ago
> OOP encapsulates data by default
That ideas's been nagging at me lately. In his paper, The Early History of Smalltalk, Alan Kay wrote, "doing encapsulation right is a commitment not just to abstraction of state, but to eliminate state oriented metaphors from programming."
Basically all code I've ever seen in OOP languages is incredibly stateful. And it makes a lot of reuse difficult, because that stateful behavior makes it difficult to confidently compose things from smaller pieces. That stateful behavior means that the class's internals aren't truly encapsulated. You still need to understand those details about how its state changes to interact with it successfully, even if you can't observe the state directly.
(http://worrydream.com/EarlyHistoryOfSmalltalk/ http://worrydream.com/EarlyHistoryOfSmalltalk/)