4 ms·
Re: classes, sounds more like you're describing structures. This is not really specific to OO, and it's available in FP languages (e.g. records in Haskell). And
by icebraining 10y ago
Re: classes, sounds more like you're describing structures. This is not really specific to OO, and it's available in FP languages (e.g. records in Haskell). And these provide scoping, which isn't really encapsulation, as far as I understand it.
- graycat 10y agoYes, I use OO classes much like I used to use PL/I structures which, of course, are generalizations of C and Cobol structures. And classes have some additional advantages, e.g., can do serialization. And, what I really like is the name scoping. For what else is significantly different in encapsulation seems a little obscure. Maybe the biggie difference is not only have the data with name scoping, but also have the code, the methods, stuffed inside the class and making changes in the data in the properties of the class. Okay -- so get to use the class and its methods without keeping track of subroutines/functions separately. Okay.