Re:Ask HN: Why do you make class members private?
by Centigonal on Monday July 25, 2022 @02:38PM
(#32228973)
I see a class as the implementation of an interface. The "interface" part of the class should be public, while the "implementation" part of the class should be private. That way, if you ever have to refactor or change the class, you can be confident your colleagues haven't built stuff on top of the "implementation" part of the class, and that you can change whatever as long as you maintain the same interface.
[ Parent
| on HN ]
There are no comments on this comment yet.