Underscore data hiding (was python development practices?)

Skip Montanaro skip at pobox.com
Thu Nov 1 07:09:53 CET 2001


    Peter> On Wed, 31 Oct 2001 18:42:03 -0600, Skip Montanaro <skip at pobox.com>
    Peter> wrote:

    >> Smiley or not, you seem to be trying a bit too hard to compare Python
    >> with C++.  They serve dramatically different audiences.

    Peter> what are these dramatically different audiences?

Perhaps I should have phrased that "designed for dramatically different
audiences".  Stroustrup designed C++ with the high-performance applications
of his employer in mind (e.g. telephone switching).  He also had C
compatibility in mind.  Guido (or Tim channeling Guido) will likely correct
me if I'm wrong, but I don't think Guido necessarily had high performance or
C compatibility in mind when he designed Python.  He was creating a
scripting language for the Amoeba distributed operating system.  The fact
that Python is "fast enough" for many things you might apply C++ to is in
large part because:

  * the types of applications to which it is applied (frequently interactive
    applications where the user is the slowest part of the system, "glue"
    applications (Paul Rubin's recent comments on horses not withstanding)
    where it provides an integration layer over libraries written in C or
    C++,

  * processor performance has increased "a lot" in the decade since Python's
    first release,

  * productivity gains outweigh (relative) performance loss (programmers are
    relatively expensive, CPU performance relatively cheap)

C++ is also roughly ten years older than Python.  The change in the
computing landscape in that ten-year period (and in the ensuing ten years)
was pretty significant.  The two languages were simply designed in quite
different environments.

Skip




More information about the Python-list mailing list