Why less emphasis on private data?
bdesth.quelquechose at free.quelquepart.fr
Sun Jan 7 21:50:40 CET 2007
Thomas Ploch a écrit :
> sturlamolden schrieb:
>>As mentioned in other replies, it is not rocket science to access a
>>class private data. In C++ you can cast to void*, in Java and C# you
>>can use reflection. C++ is said to be an "unsafe" language because
>>programmers can, using a few tricks, mess with the vtables. But how
>>many really do that?
> Exactly, if they were available, a lot more would do that.
Do you have any concrete evidence ? FWIW, I've seen a *lot* of Python
code, and very very few uses of _implementation stuff - most of them
> I think this
> is the point. Programmers who can do that normally are sensible towards
> that people who have designed this or that knew what they were doing.
> But there are enough people that don't have a clue and _will_ fiddle
> around and then flame all kind of mailing lists with requests for help
> cause they did it wrong.
The fact is that there's no cure for stupidity. If you want a language
explicitly designed to "protect" dummies from themselves, you know where
to find it. Why should normally intelligent peoples have to suffer from
this ? Are you going to forbid hammers because dummies could smash their
fingers then complain ?
More information about the Python-list