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
- Next message: Bengt Richter: "Re: is there better 32 clock() timing?"
- Previous message: Richie Hindle: "Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- In reply to: Jeremy Bowers: "Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- Next in thread: Simon Brunning: "Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Bengt Richter: "Re: is there better 32 clock() timing?"
- Previous message: Richie Hindle: "Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- In reply to: Jeremy Bowers: "Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- Next in thread: Simon Brunning: "Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|