Could Python supplant Java?

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Fri Aug 23 11:09:30 CEST 2002


"James J. Besemer" <jb at cascade-sys.com> writes:
> How about:
> 
>     def fn( arg : type ): pass

I prefer 
     def fn (arg(type)): pass

since this is closer to how class declarations work.  Local and global
variables could also be declared:

   global x(type)
   local y(type)

Right now there are no local declarations at all, which I think is a
shortcoming.  

> > Now take out all curly braces. Now take out all explicit mallocs, etc.
> > You're getting close to the equivalent lines of Python.
> 
> These lexical changes do not make huge difference in lines of python
> vs. C++.  Maybe 5-10%.  For actual data I am grepping a "typical" ~
> 70K C++ application I happen to have lying around.

I don't know about Python vs. C++ line counts.  I do know that my last
company did a number of big C++ projects before my time.  Then they did
a Java project.  They had no real Java experience before, and the Java
development environment sucked compared to the C++ environment.  Lines
of code was maybe comparable between Java and C++, and coding time
was probably also comparable.  But as one guy put it, the debugging
time with Java was at least a factor of 3 lower, despite the crappy
debugging environment, because there was almost no time spent chasing
down weird pointer errors or malloc/free errors.  It was all just logic
errors in the app that were easy to isolate and fix.  Python has similar
benefits.



More information about the Python-list mailing list