Python Productivity over C++

Roy Katz katz at Glue.umd.edu
Mon Jun 12 16:13:06 EDT 2000


I wanted to test this out, so I built a project in Python.  It is a small
CPU emulator, implementing twelve or so basic instructions (push,
pop, mov, add, interrupt-execute, etc...).  The time invested in its
Python build amounted to two hours.  Mostly of the time was spent writing
new code. 

Then I moved it to C++.  In a nutshell, this required re-writing
everything using STL.  This took me about twice as long to implement (not
counting nitpicking over the syntax errors).

Then I move to C.  The process took about twice as long as the C++
attempt; not counting the time it took for me to write miscellaneous
libraries (stack, memory allocation), I noticed that I was spending far
more time hunting pointer bugs and syntax errors than writing new
code. oThis was the longest port; it took me about four times longer than 
it did in Python. 

At the same time, C was faster than (straight) Python by a factor of
ten.  Whatever, I now have three implementations of a virtual CPU to play 
around with :)


Roey Katz



On Sat, 10 Jun 2000, Courageous wrote:

> 
> > I find it easier and quicker to lay out high level design and in
> > experimenting with finding the best class/data schema. And I can then run
> > it. The syntactical constructs of C++ tend to distract from the design
> > thought processes.
> 
> I strongly agree. In python, I get to think entirely about the problem,
> without worrying about the language/programming environment one bit,
> really. Furthermore, and this is a MAJOR win, python programs are *small*,
> which makes them easier to maintain, easier to read, and faster to code
> in general. Python is also very syntactically lightweight, which has to
> me my favorite thing about it.
> 
> Right now, I strictly use it as a rapid prototyping environment. It's
> great for testing out concepts.
> 
> 
> C/
> 




More information about the Python-list mailing list