3 ms·
I think you need to clarify what you mean by "private". Are you referring to making methods private? When you make a method public, you are making a promise to
by i_cant_speel 7y ago
I think you need to clarify what you mean by "private". Are you referring to making methods private?
When you make a method public, you are making a promise to users that you won't make any breaking changes to that API without a major version upgrade. Once something is out there, you can't take it back. So if you have some functionality that isn't meant to be used by the outside world but is used to serve your API, then you wouldn't want to expose that and tie your hands in the future.
- argimenes 7y agoAnother way of phrasing it is that a public interface is a kind of tight coupling. Also, private methods are typically contain highly factored code which may have little utility outside of the interface but which is factored for reasons of modularity.
- bjourne 7y agoThen, if I don't make any promises at all regarding my software, I should make all methods private? :)