[C++-sig] Why Python for C++ programmers

Brett Calcott brett.calcott at paradise.net.nz
Sat Dec 7 01:05:24 CET 2002

On Dec 05 15:36, David Abrahams wrote:
> Hi All,
> I'm starting work on some articles and talks about Boost.Python. Some
> of these are primarily for a "C++ audience", and I'll have to at least
> briefly make the case for why a C++ programmer should care about
> Python. Some of the answers are obvious to me, but I thought I should
> get additional feedback from a group who must have their own
> well-thought-out reasons.
> Here are some things I've thought of. 
> In broad strokes, they're complimentary because:
> * C++ is hard. Python is easy
> * C++ is fast. Python is small
> * C++ is "dangerous" (easy to crash). Python is "safe"
> * C++ is rigorous. Python is loose.
> * C++ is compiled. Python is interactive.
> * C++ has a deep and focused standard library. Python has broad
>   libraries
> * C++ has limited introspection capability. Everything in Python is
>   introspectable
> * C++ is supported to varying degrees on different platforms. The
>   latest Python really does run ``everywhere''.
> Other thoughts?
All of these things combine to make a programming experience where the
majority of the time is spent on the problem, not the intricacies of the
language you are working in. I think Eric Raymond summed it up nicely
whilst talking about his first python project:

"... I noticed I was generating working code nearly as fast as I could
type. When I realized this, I was quite startled. An important measure
of effort in coding is the frequency with which you write something that
doesn't actually match your mental representation of the problem, and
have to backtrack on realizing that what you just typed won't actually
tell the language to do what you're thinking. An important measure of
good language design is how rapidly the percentage of missteps of this
kind falls as you gain experience with the language."


More information about the Cplusplus-sig mailing list