Calling private base methods

Alex Martelli aleax at mac.com
Fri Apr 20 10:39:59 EDT 2007


Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:

> In <1176995820.855309.304040 at e65g2000hsc.googlegroups.com>, Isaac
> Rodriguez wrote:
> 
> > But the truth is that C++ and Java made a decision to do that for a
> > reason, and the times when you have to work around those language
> > features come once in a blue moon; they are the exception, not the
> > rule, and you don't implement features in a language, or for that
> > matter in an application, to simplify the exceptions; you try to
> > implement the most common scenarios.
> 
> So the most common scenario is that programmers try to poke around all the
> time in the internals of classes even if the need to do so is
> very rare?  Otherwise it would not be necessary to have and use a
> mechanism to declare everything private.  ;-)

Historically, say in the '70s, it was probably the case that experienced
programmers, trained in a very different environment, had to be nearly
coerced to respect encapsulation; so the enforced encapsulation
mechanisms of languages born at that time may well have been warranted.

Nowadays, I agree with your thesis that having extra mechanisms to
enforce encapsulation is probably supererogatory.


Alex



More information about the Python-list mailing list