Does Python really follow its philosophy of "Readability counts"?
Russ.Paielli at gmail.com
Sun Jan 18 20:51:07 CET 2009
On Jan 18, 9:22 am, Bruno Desthuilliers
<bdesth.quelquech... at free.quelquepart.fr> wrote:
> Properties by themselves are not the problem, quite on the contrary - as
> you say, they actually help wrt/ encapsulation. What breaks
> encapsulation is *automatic generation* for properties for *each and
> any* implementation attribute. Might as well just makes them all public
> attribute then.
Let me correct my statement about the automatic generation of
properties in Scala: it is only for public attributes, not all
Getting back to the bigger point, I will gladly agree with you that
data hiding is not a magic bullet that will eliminate all bugs. The
idea that I or anyone else said that, however, is a red herring. Data
hiding is just one safeguard in a portfolio of safeguards that can
*help* to prevent certain kinds of bugs as well as deliberate acts of
sabotage or fraud. When you have a tough problem to solve, you need
all the help you can get.
You keep saying that if you hire competent, trustworthy developers,
you don't need data hiding. Well, maybe, but when you have a team of
dozens or hundreds of developers, your chances of avoiding any bad
ones is zero for all practical purposes.
And even if all your developers were excellent, data hiding would
still be a convenient mechanism to simplify their jobs so they can
focus on higher level problems -- and not have to rely on an ugly
Now, if developers become careless because they think data hiding will
save them, then that would be a problem. That much I will concede. But
I doubt that happens much.
More information about the Python-list