Java vs Python

Martijn Faassen m.faassen at vet.uu.nl
Mon May 15 05:07:53 EDT 2000


Huy Do <huy at nsw.bigpond.net.au> wrote:
> I would just like to know how serious python is taken in the IT industry and
> how it compares to something like Java.

Hm, Java is taken seriously, and Python is what most companies haven't
heard about yet (though this is changing rapidly now, like your message
shows).

Note: I'm biased in favor of Python. I don't have any significant
experience programming with Java. I do have significant experience
web programming with Python, especially using Zope. But then, you asked
it in the Python group. :)

> For example

> If a web applicatoin was written in both Java and Python,
> which would companies prefer ?

*companies* would always prefer Java, because that has all the buzz,
they've heard of it, it's hyped all over the place. Whether they *should*
prefer Java is another question.

> 1. Which is more maintainable ?

Depends on the code you write, I imagine. Python may be considered less
maintainable as it's harder to enforce interfaces, can't do static type
checking, etc. Python may be considered more maintainable as its code
is shorter, more readable, you get flatter inheritance hierarchies,
you can more easily change things around, and you can more easily reimplement
things. I myself would prefer Python; I think a solidly engineered piece
of Python could would be as maintainable if not more than a solidly engineered
piece of Java code, and faster to set up to boot.

> 2. Which is more scaleable ?

As for features, I'd say this would be Java; it gets more development
in this department, and I imagine it can run on SMP machines without
any global interpreter lock.

That said, the Python environment is more dynamic which may help
you in scaling (distributed objects and so on), the Python environment
is more compact, Python may be even more portable than Java, so you
can scale up to bigger machines.
 
> 3  Which is faster eg. Java servlets or Python CGI with mod_python ?

In theory Java code should be faster; it does a lot more optimizing.
In practice however..

Zope seems to outspeed some Java servlet servers:

http://www.zope.org/Members/BwanaZulia/zope_benchmarks/benchmarks.html

More on Zope: http://www.zope.org 
Zope is based on Python. Definitely do look at Zope if you're into
web programming.

Doing the same task in Python may often be faster than Java, possibly
due to Python's high-level constructs and the huge overhead of the average
Java runtime environment. Here's some research on that and more:

http://wwwipd.ira.uka.de/~prechelt/Biblio/jccpprtTR.pdf

Note that the *development speed* with Python is generally estimated to be
quite a bit faster than the development speed with Java. This is also an
important factor!

> Please do not interpret this message as an excuse to discredit java or
> python. I am about to start a major web project using Java but have been
> referred to python as an alternative so I am investigating this option.

The main advantage of Python would be its readability and high development
speed. Another big advantage of Python is the existence of Zope. Yet
another advantage is Python and Zope's open sourceness. The main
advantage of Java would be its massive industry support.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list