Python evangelists unite!

Robert Folkerts robert at
Fri Nov 30 23:59:02 CET 2001

tanzer at (Christian Tanzer) wrote in message news:<mailman.1007104282.6353.python-list at>...
> "Peter Milliken" <peter.milliken at> wrote:
> > I use Python as a good, quick and dirty hacking language. For real (rea
>  d
> > production) stuff that I expect a customer to run or will require more 
>  than
> > a single person working for a couple of hours, I look elsewhere :-).
> Like what?
> > They could have been more productive with other languages that provide
> > better support for generic software engineering principles/standards.
> What other languages? What principles/standards?

Perhaps this is a reference to generic programming, as exemplified by
the C++ Standard Template Library.  In Python, you don't have data
types and you don't have the same level of control that you have in
C++ to declare const's that allow a complier to better optimze code. 
If your client needs to get the most out of each clock cycle, I would
choose C++ over Python.

However, my first choice would be to use C++ 'under' Python.  There
are some great examples of using Python and C++ together:
sip and the boost python libraries allow C++ and python to co-exist
Qt & PyQt are a great example of this synthesis.  (Play with
theKompany's BlackAdder, I found it a rush to write Python that
inherits & oeverides behavior defined in C++.)

PySTL is another (still rough ) indication of how C++ and Python can
coexist.  I find PySTL very exciting, because templates are a powerful
tool, but they are an incredible pain to use.  The STL is an
intellectual masterpiece and there are other examples fo fine generic
programming using templates.  If we can leverage this 'deep'
programming in Python, great!

With C++, you have a powerful OO tool, with Python you have a very
agile OO tool.  Python Programmers will run circles around C++
programmers.  But a C++ application will (after a long wait while the
coders deliver) run circles around the Python application.  In my
ideal project, you deliver version 1.0 in pure python, the client will
have a bunch of changes and a desire to get better performance.  Use 
the  very agile Python to make most of the changes and get the code
refactored into a stable, well-designed OO system.

Now, use the C/C++ to replace a few performance limiting pieces of
code.  Zope is a great example of this.  It is almost all Python with
a very limited use of C.  The C++ programmers will only write code
when there is hard evidence from profiling that you have a bottleneck.
 A development team should be able to deliver a mixed language app
that can be developed almost as fast as the Python app, while
executing nearly as fast as the C++ app.

Overtime, 'framework' code might migrate toward C++ (like in the Qt
library), while application programming (the bread and butter for must
of us) will migrate to Python (or a python-like langauge).

In summary, I feel that Python and C/C++ go together like branches and
roots.  Attacking one only harms both.

More information about the Python-list mailing list