C++ vs Python: cage match! (was Re: Results of IDE post)

Joseph A Knapka jknapka at earthlink.net
Tue Jan 8 12:47:41 EST 2002


Alex Martelli wrote:
> 
> "Joseph A Knapka" <jknapka at earthlink.net> wrote in message
> news:3C39CD84.3CCC22C at earthlink.net...
>     ...
> > C++ code, that personally I can't think of a single reason
> > to prefer C++ for any task that isn't compute-bound. (Other
> > than pointy-haired-boss issues, naturally.)
> 
> Only a very few cases come to my mind, basically connected
> to a need to use some existing/legacy code.  It can be faster
> to code a small C++ program using some existing C++ or C
> library, than to wrap the library for Python consumption
> (if it's a one-off need... maybe I just need to get more
> proficient with SWIG...).  It definitely takes a little bit
> of C++ to consume a custom non-dual, non-automation COM
> interface that Python-COM has never heard about (or at least
> this was the case when I last looked deep into it, it has
> admittedly been a while) -- then it would probably be a
> small adapter to expose the custom interface as a normal
> Automation one to Python.

Well, if you /must/ write code for a horribly broken and 
difficult-to-use platform, Python can't help you much :-)
But anyway, I concede your points.

I'm currently in the initial stages of recoding a largish
C++ device-control application in Python. It took me about
a year to write the thing in the first place; it'll be
interesting to see how long the Python re-implementation
takes. Given that a lot of the C++ development was concerned
with ironing out ideal-design-vs-practical-implementation
issues which shouldn't come up again, it's not really a fair
comparison, but interesting nonetheless. (And incidentally,
this is a Win32 app... sympathy donations may be sent to
my PayPal account... ;-)

Cheers,

-- Joe
"I should like to close this book by sticking out any part of my neck
 which is not yet exposed, and making a few predictions about how the
 problem of quantum gravity will in the end be solved."
 --- Physicist Lee Smolin, "Three Roads to Quantum Gravity"



More information about the Python-list mailing list