I come not to bury C++, but to praise it...

Donn Cave donn at u.washington.edu
Wed Jan 14 12:34:07 EST 2004


In article <100aq779r2h2c9e at corp.supernews.com>,
 claird at lairds.com (Cameron Laird) wrote:

> In article <bu3khe$dbm5v$1 at ID-46268.news.uni-berlin.de>,
> Derek <none at none.com> wrote:
> 			.
> 			.
> 			.
> >I also use C++ and Python as my main languages and I agree with your
> >comments.  However, I don't agree that Python is inherently "safer"
> >than C++.  At best I see it as a tie.  For example, C++ let's you
> >corrupt memory among other "unsafe" things, most of which can be
> >avoided by using standard containers, smart pointers, etc.  Python
> >lets you do "unsafe" things such as passing an object to a function
> >when it makes no sense to do so, which can lead to nasty runtime
> >surprises.
> 
> We disagree on some matters.
> 
> I *do* regard Python as inherently safer than C++, and much more so.
> My aim for now is not to persuade you to my view, but only to make
> it explicit.  Memory management, and mismanagement, as mundane as it
> is, is so poorly applied in so much of the C++ code I see, that it
> swamps all other dimensions of comparison between the two languages.
> I quite agree with you that competent C++ programmers should exploit
> smart pointers and so on.  My experience is that, somehow, C++ as
> it's generally practiced appears to have barriers to their use.
> 
> I don't understand your last sentence, and, given my own focus on
> reliability, I very much want to understand it.  Are you alluding
> precisely to Python's dynamic typing, and observing that, as earlier
> is better, C++'s compile-type checks beat Python's run-time checks?

Your wording is precise enough that your question could have
been better.  Note "compile type checks" vs. "run-time checks" -
a difference not only in when, but what.  There's more to it
than "earlier is better".

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list