The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Python's Design Goals

1 reply on 1 page. Most recent reply: Jan 31, 2003 9:07 AM by paco

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bill Venners

Posts: 2248
Nickname: bv
Registered: Jan, 2002

Python's Design Goals Posted: Jan 20, 2003 12:15 AM
Reply to this message Reply
Advertisement
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.html

Here'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?


paco

Posts: 3
Nickname: kulinux
Registered: Aug, 2002

Re: Python's Design Goals Posted: Jan 31, 2003 9:07 AM
Reply to this message Reply
As you say the original idea where Python is intented to "bridge the gap between the shell and C" is excellent. Also Python is a nice language in which to learn programming. But we do not agree that Python is useful when building large applications.

For instance, the improvement and maintenance of an application with 10,000 lines (not 500 lines) could be a nightmare if it has not been properly structured following a strict methodology (coding conventions, naming conventions, etc ...). Even in the best scenarios the debug is really complex, any changes to the code introduce risks to the system (you are not safe even using JUnit).

From the point of view of Object Oriented Programming (OOP) languages, the current Python implementation has several inconveniences (interfaces, access control, etc ...).

So to make a few comments on "Usefulness of privates". Do you really think they are "overused in many cases" ????

If so, has the progress achieved during the last 20 years in OOP been for nothing??

A thought. If I wrote a new chapter to Tolkiens ?Lord of the Rings?, I would at least make sure that all the races in Middle Earth were present and that none of them had experienced sudden out of character personality changes !

And about Zope, we think it is better not to speak about it. We must persevere with it ! .... :((

Flat View: This topic has 1 reply on 1 page
Topic: Unit Testing with Mock Objects Previous Topic   Next Topic Topic: Interview with Don Deutsch on JCP 2.5


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us