Does Python really follow its philosophy of "Readability counts"?

Steve Holden steve at holdenweb.com
Fri Jan 23 09:21:24 EST 2009


Bruno Desthuilliers wrote:
> Russ P. a écrit :
[...]
>> Mr. D'Aprano gave an excellent example of a large banking program.
>> Without enforced encapsulation, anyone on the development team has
>> access to the entire program and could potentially sneak in fraudulent
>> code much more easily than if encapsulation were enforced by the
>> language.
> 
> My my my. If you don't trust your programmers, then indeed, don't use
> Python. What can I say (and what do I care ?). But once again, relying
> on the language's access restriction to manage *security* is, well, kind
> of funny, you know ?
> 
I have to say that I thought the example was somewhat bogus. Any
development team that is even slightly concerned about the possibility
of logic bombs in the code will try to mitigate that possibility by the
use of code inspections.

>> I am certainly not saying that Python is useless without enforced data
>> hiding. It is obviously very useful for a wide range of applications
>> and domains already. I am only saying that it's usefulness could be
>> enhanced if enforced encapsulation can be added
> 
> You might have a chance to sell this to a clueless pointy haired boss -
> I mean,  that enforced access restriction will make Python more suitable
> for some big enterprizey project. As far as I'm concerned, I'm not
> buying it.
> 
I'm not sure that there's much to be gained by this level of dogmatism
on either side. "Enforced encapsulation" has been "implemented" in both
C++ and Java, and both have proved to be circumventable. Just the same,
talk of "clueless pointy-haired bosses" is unlikely to be convincing.
Even the pointy-haired types never recognize themselves as such.

Annotations *have* made it into 3.0, so it's possible that the might
become usable. Remember, they'll always be optional, so those who don't
want to use them won't lose anything at all.

[...]

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list