3 ms·
SelfEncapsulation
- mpweiher 10y agoOne of the problems with mandatory (and strict) self-encapsulation is that it removes the benefit of having accessors in the first place: the ability to change the accessor to do something else. If you change an accessor to do more than just provide access to the variable, it really isn't no longer an accessor, and thus shouldn't be accessing the variable. This is particularly noticeable with Objective-C properties, which enforce these rules at the language level. In essence, they turn objects into expensive structs, at least from an encapsulation point of view.