News for hackers. Stuff that matters.
Re:Ask HN: Why do you make class members private? by klyrs on Monday July 25, 2022 @03:52PM (#32230034)
> Are we assuming here that the organization is structured so that only one team works on a class, so that that's the team that knows how the bookkeeping is done and no other team should touch it?

No. If you're in such an organization, anybody on any team should be able to read the code and discover how the bookkeeping is done and locate bugs therein. A good API will obscure the necessity of bookkeeping from consumers in order to reduce bug-ridden boilerplate. Said in more highfalutin' language, privacy should be used to prevent leaky abstractions.

There are no comments on this comment yet.