I come not to bury C++, but to praise it...
Jp Calderone
exarkun at intarweb.us
Wed Jan 14 10:35:16 EST 2004
On Wed, Jan 14, 2004 at 09:42:52AM -0500, Derek wrote:
> [snip]
>
> 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.
>
A traceback is *much* less nasty than memory corruption. One stops the
program immediately and shows you exactly where the problem lies, the other
may let the program run for quite a long time before simply causing the
process to die, leaving few clues as to the source of the problem.
Python may not be *completely* safe (indeed, memory corruption is still
possible due to bugs in the interpreter and extension modules), but it is
quite a bit safer than C++.
Jp
More information about the Python-list
mailing list