Python Productivity over C++
M.-A. Lemburg
mal at lemburg.com
Fri Jun 9 11:57:38 EDT 2000
Steve Mullarkey wrote:
>
> I have been a 'C' programmer for the past 15 years and a "C++"
> programmer for the past 3 years. I'm not a genius but would modestly (?)
> class myself as reasonably competent.
>
> In the past week I have become aware of Python. I've bought a book and
> read this newsgroup every day.
>
> I have read in several places productivity claims of 5 to 10 times over
> 'C' and "C++". I would like to ask for some feedback from "C++"
> programmers who have moved to Python as to whether these estimates are
> realistic.
Let's see...
> In "C++" I have :-
>
> 1. Good tools, Borland C++ Builder, MS VC++, Memory Leak Tools,
> Profilers, Programmers Editor including Class Browser, etc..
IDEs:
* Python comes with an IDLE
* PythonWare sells a brand new product called PythonWorks which
* PythonWin is another Win32 based product
Memory Leaks:
* These can only occur if you are using cyclic references; Python1.6
will probably have cycle GC, so starting with 1.6 leaks are
probably only in C code.
Profilers:
* Python comes with a profiler.
> 2. I use the STL (Standard Template Library) which gives powerful string
> and container classes.
Python doesn't really have a need for these, since coding
polymorphic code which only relies on available interfaces
is no problem at all (Python uses name binding, not
static typing as C++).
> 3. I use incremental compiling and linking. This reduces wait times to
> very small amounts.
>
> 4. I can also use background compiling and linking.
Python compiles on-the-fly at run-time and only if needed.
You can even program interactively and have the program
compile its own code.
The typical C cycle editor-compiler-linker-debugger boils
down to a editor-run cycle -- Python provides run-time
exceptions which show you exactly where errors occurred.
> 5. I have 3rd party libraries to handle Regular Expressions, Date/Time,
> etc..
Regular Expressions are included in Python. For Date/Time
there is a 3rd party extension called mxDateTime (see my
Python Pages), for other things take a look at the
Parnassus Vaults (via www.python.org).
Best of all: Python comes with batteries included (tm)
Just scan the library documentation at www.python.org to
get an impression of what is there.
> I don't want to start a flame war but, given the above, I just can't see
> where the productivity increase is generated.
Should be obvious: Python reduces dev-time, enhances
productivity, reduces LOCs, scales well (from 5-100k LOCs
if needed -- which is roughly equivalent to 25-250k LOCs
in C++ from my own experience).
Besides, you can continue programming in C++ and then
glue everything together using Python. It offers great
extension and embedding capabilities. I have turned to
writing all object oriented code in Python and only
resort to C for low-level high performance routines.
Works well :-)
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
More information about the Python-list
mailing list