Python vs. C/C++/Java: quantitative data ?

G. Sumner Hayes sumner-nntp5 at forceovermass.com
Tue Mar 26 11:38:34 EST 2002


Eduard Smirnov <Ed.Smirnov at mail.ee> wrote:
> I’m writing a diploma paper on the difference between scripting (e.g. in
> Python or Tcl) and system programming (e.g. in C, C++ or Java)

Why do you call Python "scripting" and Java "system programming"?  I do
system programming in Python all the time.

> one of the claims I want to make is that you can often develop applications 
> 10x or more faster in a scripting language.

Shouldn't you gather some data first and then form a hypothesis to test?

Doug Bagley has an interesting paper on the subject.  Google for
"Bagley shootout" or similar.

> If you have any experience in writing applications in system programming
> language (e.g. in C, C++) and re-writing it in scripting language (e.g.
> Python) or vice versa, please compare your work in both implementations,

I did rewrite a simple SQL query utility in Python that was previously
implemented in Java (in preparation for some major new dev work on
the code).  It's a stupid case; it essentially read many
rows out of a database, did some transformations on them and dropped
some rows according to simple rules, then output an ASCII file which
was a sort of precompiled data file to be used as input by another (C)
program.

The original Java was around 1000 lines of code and ran in around 40
seconds.  The Python was around 200 lines of code and ran in around
25 seconds.  But it's a stupid case, performance differences are likely
because of different SQL drivers and file/network I/O performance.  Neither
implementation was optimized at all, both were fast enough.

I really can't compare dev time: the Java implementation went through
a couple of versions and I had to gather requirements and make major
design decisions while implementing it.  The Python was a simple rewrite
that took only an hour or two.  But a rewrite is always much faster than
an original implementation (the C program was developed over months,
but at one point a fairly substantial refactoring which resulted in a
(one piece at a time) rewrite of 50% of the code took only a few days)
if you're concentrating only on cleaning up the code and not on gathering
requirements and implementing new features.

  Sumner

-- 
rage, rage against the dying of the light

Usenet email address changes periodically.  sumner-nntp at forceovermass
period com is more permanent.



More information about the Python-list mailing list