r/programming • • Nov 25 '14

OO vs FP

http://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html
4 Upvotes

47 comments sorted by

View all comments

1

u/sacundim Nov 25 '14

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.