Python Productivity over C++
Christian Tanzer
tanzer at swing.co.at
Fri Jun 9 10:05:48 EDT 2000
"Frank V. Castellucci" <frankc at colconsulting.com> wrote:
> > There are lots of reasons. The ones first springing to my mind are:
> >
> > - The tools you mention notwithstanding, C++ still forces you to write
> > lots of low-level code by hand (e.g., memory management, the
> > `orthodox canonical class form').
> >
> > - C++ doesn't offer any means of meta-programming. If you want to add
> > some mechanism (like serialization, introspection, ...) to a class
> > hierarchy, you'll have to add member functions to every class in the
> > hierarchy. In Python you can implement the complete mechanism in the
> > root class of the hierarchy.
>
> This is crap:
>
> 1. There are gc, SmartPointer, heap management, etc. class libraries out
> there.
Guess what. Something like SmartPointer was one of the first classes I
implemented. In C++, that doesn't relieve you of thinking about memory
management, though.
> 2. There is the type information in standard conforming compilers.
Nowadays, there is.
<rant>
If you happen to use a standard conforming compiler. In 1997, there
were still several compilers that didn't even fully conform to the
1990 edition of Stroustrup und Ellis's `The Annotated C++ Reference
Manual'.
</rant>
RTTI doesn't offer any mechanisms remotely approaching Python features
like `__getattr__'/`__setattr__' though. Not to speak of `eval' and
`exec'.
> 3. There is, has been, and will be more, C++ class Class libraries which
> are powerful, easy to use, and free. I was using NIHs Class class about
> 5 years ago.
So what? Your pains start as soon as you want to combine libraries
from different sources which happen to use incompatible idioms (like
overloading global operators, ...).
> Define 'orthodox canonical class form'
J.O. Coplien's `Advanced C++ Programming' will tell you all about it.
> > [snip]
>
> People, we should all be realistic. I have seen so many language
> assertions that are unfounded or un-reasearched that the credibility of
> the author goes in the toilet with my urine.
I've used C++ and Python for projects of comparable size/complexity
and based my statements on that experience.
That's not scientific research, and of course it depends on my style
of using the two languages.
Your experience might be different.
--
Christian Tanzer tanzer at swing.co.at
Glasauergasse 32 Tel: +43 1 876 62 36
A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list
mailing list