<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class="">The problem with protected is that it provides virtually no protection at all; you can trivially expose it in a derived class</blockquote><div><br class=""></div>+<br class=""><div><br class=""></div><blockquote type="cite" class="">Extensions further dilute the enforceability of "protected", since anyone would be able to use an extension to dump methods into a class's namespace and access its supposedly-protected bits.<br class=""></blockquote><div><br class=""></div><div>I don't understand the need to protect against exposing something deliberately. We don't have a goal of restricting other developers, we're only saving them from <i class="">accidental</i> mistakes.</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class="">If a method was marked private in the base class, then it is very likely that the name of the method, the design of its argument list and its return value did not go through the same detailed design review as if the method would have been meant to be part of the class’ interface from the start. So it’s rather unlikely that increasing the visibility in an override is good idea and in the spirit of the original writer of the private method.</blockquote><br class=""></div><div>The design review and whether something is a good idea is left as a responsibility for those subclasses that choose to expose methods. The intentions of the original class author don't override the intentions of the subclass author.</div><div><br class=""></div><div><br class=""></div><div>That said, I don't necessarily believe that the protected modifier is the best solution for the problems we're discussing. Some methods are not intended to be called at all, and protected doesn't solve that.</div><div><br class=""></div><div>A.</div><div><br class=""></div></div></body></html>