Settings

Theme

Encapsulation – Where is the perimeter of a class type?

dlang.org

1 points by SilentLambda · 1 comment

Reader

1 thread
SilentLambdaOP

This D programming blog argues that C++ friend breaks encapsulation. I reject that argument, and say that C++ friend puts a door in the wall, and a guard at that door, and therefore encpasulation both remains, but is also extended (in the same way entangled particles are both encapsulated in themselves, but also in their encapsulated partner particle(s).

The article also argues that D's approach to allowing all code within a D module to be within the perimeter of any class type within that module, at all times, enhances encapsulation. I propose, that such an approach can only break encapsulation of a class type, and that it cannot possibly enhance it.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection