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

Cameron Laird claird at lairds.com
Wed Jan 14 11:05:59 EST 2004


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

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list