Article of interest: Python pros/cons for the enterprise

Nicola Musatti nicola.musatti at gmail.com
Thu Feb 21 10:37:10 EST 2008


On Feb 21, 3:46 pm, "Ryan Ginstrom" <softw... at ginstrom.com> wrote:
> > On Behalf Of Nicola Musatti
> > Newbies learn, and the fundamental C++ lessons are usually
> > learnt quite easily. Unless we're talking about idiots, that
> > is, but in this case at least C++ is likely to make their
> > deficiencies evident sooner than most other programming
> > languages. So, yes, your big company is likely to be safer
> > with newbie C++ programmers than with Python newbie programmers.
>
> The danger of memory leaks alone makes C++ a decidedly newbie-unfriendly
> language. Java I might go along with, but C++?

Memory *leaks* are just as common in garbage collected languages if
not more, thanks to C++'s deterministic destruction and its standard
library, especially if complemented with smart pointers such as
Boost's shared_ptr. At least C++ programmers tend to know that memory
must be managed, while newbies in other languages are often lead to
believe - wrongly - that the garbage collector takes care of
everything.

Dereferencing invalid pointers however is indeed a more serious
problem. This is the one lesson I had in mind when I wrote my previous
message; newbies that are not hopeless tend to learn it rather quickly
and the number of mistakes of this kind they make tends to fall in a
rather short time. I do admit however that even experienced
programmers make similar errors every now and again.

While attempting to dereference a null reference is a rather common
mistake in languages such as Java and C# - I'm not sure about Python -
the one invaluable guarantee provided by the garbage collector is the
absence of *invalid* references. This is one of the reasons why
there's an ongoing effort to add garbage collection to the C++
standard, albeit in an optional form.

Cheers,
Nicola Musatti




More information about the Python-list mailing list