Trying to choose between python and java

Steven Howe howe.steven at gmail.com
Tue May 15 03:07:34 EDT 2007


Anthony Irwin wrote:
> Hi All,
>
> I am currently trying to decide between using python or java and have 
> a few quick questions about python that you may be able to help with.
>
> #1 Does python have something like javas .jar packages. A jar file 
> contains all the program files and you can execute the program with 
> java -jar program.jar
>
> I am sort of hoping python has something like this because I feel it 
> makes it easier to distribute between platforms e.g. linux, mac 
> windows etc.
>
> #2 What database do people recommend for using with python that is 
> easy to distribute across linux, mac, windows.
>
> #3 Is there any equivalent to jfreechart and jfreereport 
> (http://www.jfree.org for details) in python.
>
> #4 If I write a program a test it with python-wxgtk2.6 under linux are 
> the program windows likely to look right under windows and mac?
>
> #5 someone said that they used to use python but stopped because the 
> language changed or made stuff depreciated (I can fully remember 
> which) and old code stopped working. Is code written today likely to 
> still work in 5+ years or do they depreciate stuff and you have to update?
>
> Anyway hopefully someone can help me out with these last few questions 
> I have.
>
> Also does anyone else have any useful comments about python vs java 
> without starting a flame war.
>
>
>   
Flame war? Here amongst all the reasonable adults programmers? It never 
happens.

1) I always thought jar files were weird. Change the run mode on you 
python script and just run it, over and over.
chmod u+x program.py
./program.py
No doubt you are (shudder) a Windows user (and beat yourself in the 
closet at night as well). No doubt Windows has a feature to set the 
privilege on a file to make it executable. With any luck, I'll never know.

2) Python interfaces with with damn near every database I've ever seen, 
regardless if the database is on the same system or remote. At worst 
case, it seems to have ODBC connection (yes I know, C and connect are 
the same thing, like an American saying Mount Fujiyama, which is of 
course, Mount Fuji Mount) feature. Not as precise as a targeted 
connector, but it works. There are even multiple ways to 'see' the 
database. As strings, lists, objects, rows, tables and dictionaries. 
It's all quite a powerful tool. Image, getting to choose how you 'see' 
the database. Who'd have thunk!

3) No idea about jfree. Perhaps a few keyword searchs on Google or 
Sourceforge would give you an answer.

6) Never programmed wx. But it seems to be very stable on the programs 
I've downloaded. Anyway mapping one GUI to another is always an 
imprecise effort (especially when you have 235 patents on the product 
that you dare not tell anyone about). No two mindset ever really meet, 
especially when money is involved.

5) All languages grow. Get over it. But, if you keep the older 
interpreter around, you can still run your old scripts. At NCR I had to 
support 6 different version of Perl because the programmers wouldn't 
fix/update their code. Seem they had better things to do and you can 
always expect the Sysadmin to save your bacon. 
But if you haven't got to that point (six version to support) yet, 
during pre-upgrade tests, you might run the program and note the 
features that are going to be decrepit. Generally you have a few minor 
version releases (year or more) before the decrepit feature is dropped. 
Then you can decide if upgrading/fix or running multiple version of 
python is the right path for you. Using the PYTHONPATH environment 
variable is a good way to redirect your older scripts to use decrepit 
feature via an older interpreter.

The (6) you didn't ask. As a Sysadmin, I hate Java. It's a resource hog. 
Little tasks take hundreds of megabytes of RAM. What can one expect. 
It's a virtual machine inside your computer. Hog it must be! Python is a 
bit slimmer on the memory footprint and I think a hell of a lot easier 
to debug. Even strace can be used on python programs. Never got strace 
to work on Java scripts.

The (7) you didn't ask. Last month there was a full flame war about 
java/python on the python-list. It petered out after about 15 days. You 
might review the archives to get a sense for yourself (so we don't have 
repeat the war, just for you).
 
sph


-- 
HEX: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0




More information about the Python-list mailing list