Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)

From: Sion Arrowsmith (siona_at_chiark.greenend.org.uk)
Date: 01/25/05


Date: 25 Jan 2005 12:38:50 +0000 (GMT)

Jeremy Bowers <jerf@jerf.org> wrote:
> [ ... ] the Python community, and in general the dynamic language
>community, has become increasingly confident that private variables don't
>solve *real* problems.

Years of writing and maintaining others' C++ and Java code (plus
one year of maintaining Python code and rather more writing) has
led me to believe that there is no justification for truly private
variables. "protected" yes, I can see the argument for, but
denying derived classes full access to your inner workings just
leads to clumsier (less readable and more bug-prone) implementations
derivations. (The same applies to Java's "final".) And it's based on
the hubris that you are a better programmer than anyone who might
want to extend your class and can forsee all circumstances in which
it might be subclassed.

-- 
\S -- siona@chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomež se bera eadward ofdun hlęddre heafdes bęce bump bump bump


Relevant Pages

  • Re: Syntax checker
    ... designed a JSP Page as an UI for the user to enter formulas. ... price = 20. ... do to retreive and convert to java code, ... Doing this would require writing a full blown compiler. ...
    (comp.lang.java.help)
  • Need 5k lines of java code for testing
    ... is there are way to get 5k-10k lines of simple java code for writing ... Prev by Date: ...
    (comp.software.testing)
  • Re: Need 5k lines of java code for testing
    ... updatedkrishna wrote: ... > is there are way to get 5k-10k lines of simple java code for writing ... Prev by Date: ...
    (comp.software.testing)