|
|
|
|
|
by DonaldPShimoda
2618 days ago
|
|
In Kay's OO the only way to interact with an object was through method passing. It was important the the internal state of an object was kept private at all times. Getters/setters are technically message-passing methods, but they undermine the design goal because they more or less directly expose internal state to the public world. But we see getters/setters used constantly. People don't use OO in the way Kay intended. Yes, methods are the implementation of the whole "message passing" thing Kay was talking about, but we see them used in ways he did not intend. |
|
I wonder if we had different syntax for those cases we'd have less of them.
But then, again, it's very convenient to be able to add a method to a class that was previously a dumb struct.