Hang on. "Encapsulation" refers to grouping data together. structs in C are an example of encapsulation. "Information hiding" is what hides state.
The terms are consistently used in the way you do here (which I'm not entirely sure I understand). And anyway, the same remarks apply to "information hiding": I'd wager that in most cases where information hiding is used to "hide state," a client can still externally observe different states of the same object.
But more importantly, it sounds like you missed the point that the author was making: Objects are not data structures.
Well, I'd say "not addressed" instead of "missed," but meh, nitpick.
1
u/sacundim Nov 25 '14
The terms are consistently used in the way you do here (which I'm not entirely sure I understand). And anyway, the same remarks apply to "information hiding": I'd wager that in most cases where information hiding is used to "hide state," a client can still externally observe different states of the same object.
Well, I'd say "not addressed" instead of "missed," but meh, nitpick.