Java and Python

Magnus Lyckå magnus at thinkware.se
Wed Mar 20 07:59:37 EST 2002


Hi, as a Java coder you might want to look
into Jython and combine your skills. That
would for instance enable you to quickly
prototype Java programs in Python.


Ahmed Moustafa wrote:

> May I ask you what the scal for your webapp was? (Because MySQL is 
> related to small to mid-size web applications). Is it the same case with 
> Python?



Not at all.


But I think both MySQL and Python scales well.
MySQL has some shortcomings, and since the
purchase cost is so low :) it's a good
choise for systems with a small budget. But
don't dismiss is as a weak database in larger
settings. In places where you have many more
reads than transactions, MySQL might well be
the fastest choise.


Python code doesn't compile to native machine
code, only to byte code, so in some situations
it can't compete with C. But you should be aware
that
  - Python integrates well with C, and possible
    bottle necks can be coded in C and used as
    extension modules. Such a solutin might well
    be much faster than a pure Java solution.
  - In most web apps it's often other factors such
    as network and databases that are the bottle necks.
  - Since the development time will be shorter, you
    will have more money left for hardware.


 From a design point of view Python has the constructs
that you need to build big applications. Classes,
namespaces, modules and packages etc.


Since Python code is typically much shorter (3-10 times)
than C, C++ or Java, and more easy to read, it's a good
language for high demands. I don't know what size you are
thinking of.  My current app is maybe 5 000 lines of code
if you remove comments and empty lines. It's about 140
classes. I would guess that it would have been at least
15 000 lines of Java. I don't worry a bit about this getting
out of hand.


There are many big web apps written in Python.
- Zope is an web application server. See www.zope.com for
   some customer references.
- ReportLab (www.reportlab.com) has large installations.
   Their main piece of code is open source, but for those
   who don't trust freeware they have a commercial XML
   solution that costs from $10 000. Demos on the site.
- Google runs a lot of Python code.


Among other Python programs we can mention the use for
animations in the latest Star Wars film, and here in
Scandinavia a lot of manipulations of metereological
data and images are done with Python. See
http://www.thinkware.se/cgi-bin/thinki.cgi/PythonUsers
for some more examples of Python use.


/Magnus




More information about the Python-list mailing list