Discussion

Ask HN: Why are private/hidden methods so popular in OOP APIs?

As a Python programmer, I heartily subscribe to the philosophy of "we're all consenting adults here" [0]. Nothing should really be private or hidden, because nothing is really stopping a canny user from cracking open your code and accessing that stuff anyway.

However, it seems like the opposite philosophy is the prevalent one, so I must ask why? Why do people inside on concealing and privatizing so much of their code, especially in open source projects where I can clearly see what they're doing?

Thanks.

[0]: https://mail.python.org/pipermail/tutor/2003-October/025932.html

7 points swidi 7 years ago 13 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton