Artima.com has published Part II of an interview with Python creator Guido van Rossum in which he discusses how he originally intended Python to "bridge the gap between the shell and C," and how it eventually became used on large scale applications.---xj40dkcfea73---Artima.com has published Part II of an interview with Python creator Guido van Rossum in which he discusses how he originally intended Python to "bridge the gap between the shell and C," and how it eventually became used on large scale applications.
http://www.artima.com/intv/pyscale.htmlHere's an excerpt:
The addition of privates was another small language change that was meant to make writing large programs easier. To me, it's mostly useful to address people's irrational fears than act as a practical tool. There are situations where privates are very useful, because you know you have your own namespace. But in many cases, I think it is overused.
People who fear that someone will call their code with the wrong arguments, and who are used to having static-typed language prevent that at the compiler level, will try to prevent that happening in their code by adding explicit assertions. People will check the types. They'll think, "Oh, this only works for strings, so now I'll assert that the input argument is a string."
That is the completely wrong approach, because someone could easily implement something that works just as well with your code and behaves sufficiently like a string. Maybe it's a proxy for a string, which behaves in almost every aspect as a string, except that its type is a proxy. That's something we use in Zope a lot. The persistency mechanism uses proxies, as does the security mechanism that executes untrusted Web- submitted code. Untrusted code is executed in a sandbox environment using proxies for objects that the code shouldn't be accessing directly. So the fact that the language doesn't enforce types at either the compiler level or the implementation level is actually helpful.What do you think of Guido's comments in the article? In particular, what's your opinion about the utility and proper use of privates?