By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,928 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,928 IT Pros & Developers. It's quick & easy.

Trying to choose between python and java

P: n/a
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.
--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
May 15 '07 #1
Share this Question
Share on Google+
34 Replies


P: n/a
In <f2**********@news-01.bur.connect.com.au>, Anthony Irwin wrote:
#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
There are .egg files but usually distributing a program consisting of
several files isn't a big problem. There is a mechanism to write a
`setup.py` that copies the files into the correct locations. Look for
`distutils` in the library docs.
#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.
From Python 2.5 the standard library contains SQLite support. There are
third party libraries to many DBMSs like MySQL, PostgreSQL, Oracle etc.

The situation with MySQL bindings under Windows was a bit troublesome
recently. The author of the bindings doesn't use Windows and does not
provide pre-built binaries.
#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?
Likely yes, but you better check. Same applies to Java GUIs.
#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?
That sounds odd because the language and standard library is very
backwards compatible. There are some things deprecated with a comment in
the docs and in some cases runtime warnings, but the code still works.

With Python 3.0 some things will break, because there's some cruft in the
language and library that accumulated over time, just because backwards
compatibility was such a high priority. The 2.x series will be supported
for some time parallel to 3.x, so there is enough time to migrate.

Ciao,
Marc 'BlackJack' Rintsch
May 15 '07 #2

P: n/a

"Anthony Irwin" <no****@noemailhere.nowherewrote in message
news:f2**********@news-01.bur.connect.com.au...
| #2 What database do people recommend for using with python that is
| easy to distribute across linux, mac, windows.

Check out the sqlite3 module. (But I have not used it yet).

| #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?

Most versions of Python are still available. You are free to use and
distribute your copies indefinitely. Several older versions are still in
use.

Recent releases have added features but removed very little except bugs.
Unfortunately, bug removal sometimes breaks code. And feature additions
occasionally introduce bugs or otherwise break code, but that is why there
are alpha, beta, and candidate releases before a final release.

Python3 will remove many things at once. A conversion tool is being
written. And there is no expectation that production code should be
immediately converted, if ever.

Terry Jan Reedy

May 15 '07 #3

P: n/a
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

May 15 '07 #4

P: n/a
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.
It depends on what you see as the benefit of jar's. If it is purely a
matter of packing your whole application up into a single file that you
can distribute then there are a number of tools to do that, each with
their limits. Search for cx_freeze or py2exe (win32 only).
#2 What database do people recommend for using with python that is easy
to distribute across linux, mac, windows.
You could use sqlite, which comes included with Python 2.5. The database
files it creates are cross-platform usable and using sqlite saves you
the trouble of having to set up a database server
#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?
Likely yes, but guaranteed no. You'll simply have to test to see how
your program comes out on the other platforms. You could use a GUI
toolkit that draws its own widgets instead of one that uses the native
controls, like wxPython does. PyGTK comes to mind, not sure if it is
available on the 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?
The changes I can remember from the last couple of years seem to be
mostly addition of new features to the language and more standard
modules being included in the standard Python distribution. Of course,
some things were deprecated, but I think actual code-breaking changes
were not that common. But with Python 3.0 (still a long time to go)
there will definitely be some incompatibilities, but a lot can probably
be fixed automatically using an included conversion tool.

Here's a description of the changes in the last 3 releases (2.5, 2.4,
2.3). These span a bit more than 3 years, as 2.3.0 was released on July
29th, 2003, with 2.5.0 on September 19th, 2006. Perhaps you can get a
feel for the kind of changes from one release to the next.

http://docs.python.org/whatsnew/whatsnew25.html
http://www.python.org/doc/2.4/whatsnew/whatsnew24.html
http://www.python.org/doc/2.3/whatsnew/
Also does anyone else have any useful comments about python vs java
without starting a flame war.
I guess it all depends on what you're going to use it for and what your
goals and restrictions are. I've never seriously used Java (only a bit
of C#), but I've been developing a GUI app with wxPython for the last
couple of months and am pretty happy with it. Before that, I did lots of
tooling with Python (conversion scripts, small computational stuff, etc)
and was happy as well. So overall, I'm happy with Python :)

It's pretty powerful for a wide variety of applications, comes with a
large collection of modules for everything from networking to file
compression to encryption to xml parsing to database handling to ...
(see http://docs.python.org/lib/lib.html). I find code in Python to be
more easily readable because of the absence of unneeded brackets and the
fact that code that forms a block is always aligned properly (eeek,
possible flame-war subject here). And it saves on the number of type
strokes as well. Overall, great stuff!

Paul
May 15 '07 #5

P: n/a
Ant
On May 15, 6:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
#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
As someone else has said, Python has eggs: http://peak.telecommunity.com/DevCenter/PythonEggs
#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.orgfor details) in python.
I can't remember what it is I use - I haven't got access to my server
at the moment... But look in the cheese shop - I'm fairly sure it was
from there. I'll post details if I remember. Alternatively this looks
good (though I haven't tried it and it's only free for non-commercial
use): http://www.dislin.de
#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?
Any language will have some compatibility problems when upgrading to a
different version, and so you have the option of updating your program
or using an old version of the language. I'm a professional Java
developer, and though Java 6 has been out for some time now, every
company I've worked for in the last couple of years still uses Java
1.4 due to problems with the upgrade.

Python does strive however to stay backward compatible (3k not
withstanding), and I've upgraded from 2.3 to 2.4 and now 2.5 with no
problems.
Also does anyone else have any useful comments about python vs java
without starting a flame war.
As I said, I'm a professional Java developer, and much prefer
programming in Python when I can (and am even getting quite a lot of
Python work at the moment via Jython :-) )

--
Ant...

http://antroy.blogspot.com/
May 15 '07 #6

P: n/a
>#3 Is there any equivalent to jfreechart and jfreereport
>(http://www.jfree.org for details) in python.
ChartDirector
http://www.advsofteng.com/download.html

Again, not free for commercial use, but very versatile.

~Sean

May 15 '07 #7

P: n/a
Anthony Irwin a écrit :
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
Python eggs
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.
Note that while highly portable (and ported), Python is not as autistic
as Java and doesn't try to pretend the underlying platform doesn't
exists...
#2 What database do people recommend for using with python that is easy
to distribute across linux, mac, windows.
If you're thinking of embedded databases, the answer is SQLite. Else,
PostgreSQL and MySQL both run on Windows and mowt unices.
#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
s/depreciated/deprecated/
(I can fully remember which)
and old code stopped working.
This is very strange, and even looks like FUD. Python has gone very far
into maintaining compatibility, and there's a lot of pretty old code
still running on latest Python versions.
Is code written today likely to still work
in 5+ years or do they depreciate stuff and you have to update?
I still use code written more than five years ago.
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.
Err... reading the last words, I think I'd better shut my mouth now.

May 15 '07 #8

P: n/a
Steven Howe a écrit :
(snip)
>>
Flame war? Here amongst all the reasonable adults programmers? It never
happens.
Lol ! +1 QOTW
May 15 '07 #9

P: n/a
En Tue, 15 May 2007 05:43:36 -0300, Bruno Desthuilliers
<br********************@wtf.websiteburo.oops.comes cribió:
>Is code written today likely to still work
in 5+ years or do they depreciate stuff and you have to update?

I still use code written more than five years ago.
Just as an example, PIL (Python Imaging Library) works unchanged with any
version from Python 1.5 (released 1999) till the latest 2.5 (released this
year)

--
Gabriel Genellina

May 15 '07 #10

P: n/a
Anthony Irwin <no****@noemailhere.nowherewrote:
#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?
wx adopts the native look and feel for the platform. I've used it
under linux and windows where it looks fine! I've never used it under
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?
The language does change gently. New language features are added.
Backwards compatibility is deemed very important. Read PEP 5
"Guidelines for Language Evolution" for more info.

http://www.python.org/dev/peps/pep-0005/

Libraries are deprecated but not removed. Read PEP 4 "Deprecation of
Standard Modules" if you want to know more.

http://www.python.org/dev/peps/pep-0004/

There is more churn in the libraries which aren't distributed with
python.

There is also the Python 3000 project. The point of this project is
to remove the deprecated stuff and the accumulated cruft and make
python shiny and new again. A lot of python programs will run
unmodified under Python 3000 anyway. However there is a translator to
translate to the new Python 3000 format. Python 3000 is probably a
year from its first stable release. I suspect it won't be in wide use
for several years after that.

http://www.python.org/dev/peps/pep-3000/

Don't be scared of Python 3000 though it is just a gentle revision of
the language, nothing like, lets say, going from perl 5 to perl 6.
Also does anyone else have any useful comments about python vs java
without starting a flame war.
You'll be a lot more productive writing python code in my experience
so if development time is important to you, then go with python.

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
May 15 '07 #11

P: n/a
On 15 May, 07:30, Anthony Irwin <nos...@noemailhere.nowherewrote:
>
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
Some people will propose Python .egg files, but I believe plain .zip
files containing packages may be enough for your purposes, provided
that there are no native code libraries inside.
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.
See also...

http://wiki.python.org/moin/DistributionUtilities
#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.
See the following pages for guidance:

http://wiki.python.org/moin/DatabaseProgramming
http://wiki.python.org/moin/ChoosingDatabase

You will probably be most interested in sqlite, particularly as
support for that database system is now part of Python's standard
library (from Python 2.5 onwards), although the libraries are also
available separately.

[...]
#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?
It's "deprecated", not "depreciated", by the way!

I tend to complain about changes in the language a lot, mostly because
I think that they can be confusing and off-putting for beginners, make
documentation and literature outdated, and distract from more
important areas of improvement, but I don't think that previous
language changes have necessarily caused me many problems. My own
active projects are at most around four years old, but as these
projects have developed, I think that language changes have been the
least of my problems. ;-)

People could use such things as an excuse to bash Python, but the
favourite languages of some of those people may well be undergoing
fundamental changes with substantial potential breakage and no
reasonable escape from the upgrade treadmill. Meanwhile, it's
completely possible to stick with a particular version of Python and
to write code against that without being forced to upgrade because of
stability issues. Indeed, Python has reached a level of maturity
(unlike certain competitors) where a conservative approach to version
adoption is completely viable: I'm using Python 2.3.x in my work, and
aside from a few conveniences that I miss from using Python 2.4.x
elsewhere, it's still very much a going concern.

Python 3.x will be somewhat different from Python 2.x, but people are
working on tools to help developers target both branches of the
language simultaneously, and it wouldn't surprise me if the 2.x series
continued in such a way that the differences between the branches get
smaller over time as developers gradually adopt the ways of the
refined 3.x language and libraries - this has been happening with Zope
2.x and Zope 3.x, in fact. Personally, I plan to stick with Python 2.x
for some time to come unless something really compelling shows up in
Python 3.x, and I even intend to hang on to Python 2.4.x for as long
as I reasonably can. There's no point in upgrading systems purely for
the sake of upgrading.

Paul

May 15 '07 #12

P: n/a
Anthony Irwin <no****@noemailhere.nowherewrites:
#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
Python does this with eggs and distutils that copy your files into the
proper location. For os x you also have py2applet which creates an
application bundle that can be put onto a disk image and dragged into
the Applications folder. A similar utility exists for MSWin, but I've
not used it.
#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.
pysqlite3 for python is included in python 2.5 and can be added to
python 2.4. For java you would probably use HyperSonic or Derby. At
least one winner in the java camp for me is db4o, which is a bit like
shelve on steroids with an object-oriented query language.
#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?
There are enough idiom differences between OS X, MSWin, Gnome and Qt
that native look and feel is very, very difficult to achieve. Java
comes close with SWT. WxPython applications seem to port badly to OS
X, and are tricky to build into an application bundle.

As a example of how these differences in idioms can become problems,
Mozilla Thunderbird on OS X regularly has issue with unmodified
keybindings. With Thunderbird 2.0 shift-J marks a message as junk,
even when you are entering text into a dialog box. The tkinter
application Leo uses the control key as a modifier on OS X rather than
the command key. The basic point is that you need to test on all
platforms you want to develop for.

My very biased view of the domain is as follows:
OS X/Cocoa: PyObjC
KDE + Win + OS X/X11: PyQt
Win + Gnome + OS X/Carbon: wxPython or Jython+SWT
Simple, easy, and universal: tkinter
Rich, complex, and universal: Jython+Swing
Also does anyone else have any useful comments about python vs java
without starting a flame war.
I've found it useful to use a mix of pure java and jython, although
I'm still working through some gotchas in regards to compiling jython
code that's acessible from java.
--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
--
Kirk Job Sluder
May 15 '07 #13

P: n/a
On May 15, 7:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
#1 Does python have something like javas .jar packages.
Yes. .egg files.

#2 What database do people recommend for using with python that is
easy to distribute across linux, mac, windows.
Depends on your needs:

1. Berkely DB - not relational, zero administration, very fast
(bundled with Python).
2. SQLite - zero administration, quite fast (bundled with Python).
3. MySQL - relational database server, fast, GPL
4. Oracle - relational database server, sluggish, commercial
#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.orgfor details) in python.
Yes.

reportlab
matplotlib

#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?
Yes.

But you should test anyway.

#5 someone said that they used to use python but stopped because the
language changed or made stuff depreciated
Python is no worse than Java with respect to that.
May 15 '07 #14

P: n/a
On May 15, 1:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:

<snip>
#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?
Because Python 3 will change the syntax of print to disallow

print "Hello, world."

a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.

May 15 '07 #15

P: n/a
#3 Is there any equivalent to jfreechart and jfreereport
(http://www.jfree.orgfor details) in python.
I haven't used either extensively but you might check out ReportLab
for report generation (http://www.reportlab.org). And MatPlotLib for
creating plots, charts and graphs (http://matplotlib.sourceforge.net).
There may be alternatives available.

Matt

May 15 '07 #16

P: n/a
On May 15, 7:29 pm, Beliavsky <beliav...@aol.comwrote:
print "Hello, world."

a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.
In the vent that your Python 2.x install will be fubar and suddenly
stop working the day Python 3k is released: how difficult will it be
it to make a Python 3k script that corrects your code?


May 15 '07 #17

P: n/a
sturlamolden wrote:
On May 15, 7:29 pm, Beliavsky <beliav...@aol.comwrote:
>print "Hello, world."

a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.

In the vent that your Python 2.x install will be fubar and suddenly
stop working the day Python 3k is released: how difficult will it be
it to make a Python 3k script that corrects your code?
It's worth mentioning that providing such a script is of high priority for the
Python 3.0 team. They've already implemented the translation for print
statements, too:

http://svn.python.org/view/sandbox/trunk/2to3/
http://svn.python.org/view/sandbox/t...4501&view=auto

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

May 15 '07 #18

P: n/a
Ant
On May 15, 9:17 am, Ant <ant...@gmail.comwrote:
....
I can't remember what it is I use - I haven't got access to my server
at the moment... But look in the cheese shop - I'm fairly sure it was
from there. I'll post details if I remember. Alternatively this looks
good (though I haven't tried it and it's only free for non-commercial
use):http://www.dislin.de
It's pychart that I use fr charting. Nice and simple to use - though I
only use it for simple charts, so I'm not sure how powerful it is.
--
Ant...

http://antroy.blogspot.com/
May 15 '07 #19

P: n/a
In article <f2**********@news-01.bur.connect.com.au>,
Anthony Irwin <no****@noemailhere.nowherewrote:
>
#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?
You're probably thinking of
http://www.gbch.net/gjb/blog/softwar...hon-sucks.html

Thing is, while he has a point, I don't think it's a very good one. For
example, just yesterday in upgrading from Java 1.4.2 to Java 5.0, I had
to fix a bunch of instances of "package foo.bar.baz;" to "package baz;"
because apparently the latter is now "correct". Bugfixes happen, and
sometimes they break working code.
--
Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/

"Look, it's your affair if you want to play with five people, but don't
go calling it doubles." --John Cleese anticipates Usenet
May 15 '07 #20

P: n/a
Beliavsky a écrit :
On May 15, 1:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:

<snip>
>>#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?


Because Python 3 will change the syntax of print to disallow

print "Hello, world."

a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.
The fact that Py3K will be a "big cleanup" release is not new - it has
been clear for some years now that this would be the first release that
would break compatibility. Still GvR and the team seem to be making
their best to not avoid as much breakage as possible, clearly document
what will break, and if possible provide tools to ease migration.

I've been using Python since 1.5.2 and had no problem yet with upgrades.
I couldn't say so of some proprietary languages I've used, where each
minor release could potentially break something - not talking about
major ones that were certified to imply a full rewrite (and I'm not
talking of something as easily scriptable as replacing print statements
with a function or method call).
May 15 '07 #21

P: n/a
On May 15, 5:16 pm, Bruno Desthuilliers
<bdesth.quelquech...@free.quelquepart.frwrote:
Beliavsky a écrit :
On May 15, 1:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
<snip>
>#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?
Because Python 3 will change the syntax of print to disallow
print "Hello, world."
a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.

The fact that Py3K will be a "big cleanup" release is not new - it has
been clear for some years now that this would be the first release that
would break compatibility.
Eliminating core libraries breaks compatibility. Getting rid of regex
was very traumatic, and I still find myself occasionally patching up
code because of that change. To be fair, regex was deprecated for
many versions before it was dropped (and warned loudly of the coming
change), and Java's been notably worse at maintaining backward
compatibility. But saying it's the first release that breaks
compatibility isn't true unless you have a very limited definition of
compatibility.
Still GvR and the team seem to be making
their best to not avoid as much breakage as possible, clearly document
what will break, and if possible provide tools to ease migration.
Absolutely.

May 15 '07 #22

P: n/a
Hi All,

Thanks to all that replied.

I noticed that someone said that the way you used regular expressions
changed at some point. That is probably what upset the person I was
talking to about python they are a huge perl fan and use regular
expressions heavily.

The reason for asking about the .jar type functionality was to try and
make it easier to distribute the application as some people said. I
run linux systems and if I want to give the app to a windows user then
I don't really want to muck about trying to create a windows install
for them as I don't personally have a copy of windows to do it with so
I thought that just giving them one file and telling them to install
the run time environment would make it easier.

I tend to use the shebang #!/usr/bin/env python in my scripts so far
but I imagine that having that would not work on say windows. Or is
there some kind of file extension association for people running
windows instead of the shebang?

I saw on the python site a slide from 1999 that said that python was
slower then java but faster to develop with is python still slower
then java?

--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
May 16 '07 #23

P: n/a

On May 15, 2007, at 8:21 PM, Anthony Irwin wrote:
I saw on the python site a slide from 1999 that said that python was
slower then java but faster to develop with is python still slower
then java?
I guess that all depends on the application. Whenever I have a
choice between using something written in Java -- and *anything else*
-- I choose the non-Java option because the JVM is such a hog-beast.
Sure, once it is running, it may run at a nice clip (which is not my
experience but I don't want to seem argumentative) but loading the
Java environment is a pain. Perfect example is with Aptana, which I
*really* like -- but if I want to use it, I've got to shut everything
else off -- and it still brings my poor old machine to its knees
(note: my computer doesn't actually have knees).

I've never developed in Java though. Lots of people do, so it must
have it's merits.

Michael

---
The Rules of Optimization are simple.
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
-Michael A. Jackson
May 16 '07 #24

P: n/a
sj*******@yahoo.com a écrit :
On May 15, 5:16 pm, Bruno Desthuilliers
<bdesth.quelquech...@free.quelquepart.frwrote:
>Beliavsky a écrit :
>>On May 15, 1:30 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
<snip>
#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?
Because Python 3 will change the syntax of print to disallow
print "Hello, world."
a substantial fraction of Python programs in existence, including all
of my programs, will be broken. Draw your own conclusions.
The fact that Py3K will be a "big cleanup" release is not new - it has
been clear for some years now that this would be the first release that
would break compatibility.

Eliminating core libraries breaks compatibility. Getting rid of regex
was very traumatic, and I still find myself occasionally patching up
code because of that change. To be fair, regex was deprecated for
many versions before it was dropped (and warned loudly of the coming
change), and Java's been notably worse at maintaining backward
compatibility. But saying it's the first release that breaks
compatibility isn't true unless you have a very limited definition of
compatibility.
Looks like you're right on this - there have been at least one
"compatibility-break" release before. As far as I'm concerned, I have
been totally unaffected by this change, which is probably why I don't
even remember it.
>Still GvR and the team seem to be making
their best to not avoid as much breakage as possible, clearly document
what will break, and if possible provide tools to ease migration.

Absolutely.
May 16 '07 #25

P: n/a
In article <f2**********@panix3.panix.com>, Aahz <aa**@pythoncraft.comwrote:
>In article <f2**********@news-01.bur.connect.com.au>,
Anthony Irwin <no****@noemailhere.nowherewrote:
>>
#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?

You're probably thinking of
http://www.gbch.net/gjb/blog/softwar...hon-sucks.html

Thing is, while he has a point, I don't think it's a very good one. For
example, just yesterday in upgrading from Java 1.4.2 to Java 5.0, I had
to fix a bunch of instances of "package foo.bar.baz;" to "package baz;"
because apparently the latter is now "correct". Bugfixes happen, and
sometimes they break working code.
Update: I was wrong about the package thing -- turned out that someone
had made a backup copy of our code inside the source tree, and so ant
merrily went along and gave nice "duplicate class" errors...
--
Aahz (aa**@pythoncraft.com) <* http://www.pythoncraft.com/

"Look, it's your affair if you want to play with five people, but don't
go calling it doubles." --John Cleese anticipates Usenet
May 16 '07 #26

P: n/a
I tend to use the shebang #!/usr/bin/env python in my scripts so far
but I imagine that having that would not work on say windows. Or is
there some kind of file extension association for people running
windows instead of the shebang?
The shebang is ignored in Windows (as far as I know). There is
are .py, .pyc, .pyo and .pyw associations added to the registry when
you install Python on a Windows machine. They can be executed like any
other program.
I saw on the python site a slide from 1999 that said that python was
slower then java but faster to develop with is python still slower
then java?
I don't have any numbers, but yes it probably is a bit slower for some
tasks. Especially for hardcore number crunching. Of course, you can
always rewrite the slow bits in C and get a speedup. Also, there are
optimizers that are supposed to work pretty well. In the end though,
Python is fast enough for most tasks. For very heavy computation I
wouldn't use Java either. The interpreter does seem to start much
quicker than the JVM.

Also, I'm sure it has been mentioned, but you might checkout Jython,
which is essentially python written in Java.

Matt

May 16 '07 #27

P: n/a
In article <ma***************************************@python. org>,
Terry Reedy <tj*****@udel.eduwrote:
>
"Anthony Irwin" <no****@noemailhere.nowherewrote in message
news:f2**********@news-01.bur.connect.com.au...
May 16 '07 #28

P: n/a
In article <f2**********@info.science.uva.nl>,
Paul Melis <pa**@science.uva.nlwrote:
>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.

It depends on what you see as the benefit of jar's. If it is purely a
matter of packing your whole application up into a single file that you
can distribute then there are a number of tools to do that, each with
their limits. Search for cx_freeze or py2exe (win32 only).
May 16 '07 #29

P: n/a
In article <f2**********@info.science.uva.nl>,
Paul Melis <pa**@science.uva.nlwrote:
May 16 '07 #30

P: n/a
Cameron Laird wrote:
In article <ma***************************************@python. org>,
Terry Reedy <tj*****@udel.eduwrote:

"Anthony Irwin" <no****@noemailhere.nowherewrote in message
news:f2**********@news-01.bur.connect.com.au...
.
.
.
| #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?

Most versions of Python are still available. You are free to use and
distribute your copies indefinitely. Several older versions are still in
use.

Recent releases have added features but removed very little except bugs.
Unfortunately, bug removal sometimes breaks code. And feature additions
occasionally introduce bugs or otherwise break code, but that is why there
are alpha, beta, and candidate releases before a final release.

Python3 will remove many things at once. A conversion tool is being
written. And there is no expectation that production code should be
immediately converted, if ever.
.
.
.
I'll answer even more aggressively: Python's record of
backward compatibility is *better* than Java's.
Although I objected earlier to the statement that Python has never had
a release breaking backward compatibility, I agree 100% with this--the
times that Python has broken backward compatibility have been preceded
by several releases of deprecation warnings. Java on several
occasions has simply broken working code in a new release with no
warning. I wouldn't be shocked if Python has done the same, but I've
never run into it in my code.

May 17 '07 #31

P: n/a
sj*******@yahoo.com wrote:
Cameron Laird wrote:
>In article <ma***************************************@python. org>,
Terry Reedy <tj*****@udel.eduwrote:
>>"Anthony Irwin" <no****@noemailhere.nowherewrote in message
news:f2**********@news-01.bur.connect.com.au...
.
.
.
>>| #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?

Most versions of Python are still available. You are free to use and
distribute your copies indefinitely. Several older versions are still in
use.

Recent releases have added features but removed very little except bugs.
Unfortunately, bug removal sometimes breaks code. And feature additions
occasionally introduce bugs or otherwise break code, but that is why there
are alpha, beta, and candidate releases before a final release.

Python3 will remove many things at once. A conversion tool is being
written. And there is no expectation that production code should be
immediately converted, if ever.
.
.
.
I'll answer even more aggressively: Python's record of
backward compatibility is *better* than Java's.

Although I objected earlier to the statement that Python has never had
a release breaking backward compatibility, I agree 100% with this--the
times that Python has broken backward compatibility have been preceded
by several releases of deprecation warnings. Java on several
occasions has simply broken working code in a new release with no
warning. I wouldn't be shocked if Python has done the same, but I've
never run into it in my code.
Ask the Twisted guys - they mentioned when 2.5 was released that several
of their unit tests broke.

Just the same, I do think Python's compatibility record is good.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 17 '07 #32

P: n/a
On May 16, 2:21 am, Anthony Irwin <nos...@noemailhere.nowherewrote:
Hi All,

Thanks to all that replied.
<SNIP>
>
I saw on the python site a slide from 1999 that said that python was
slower then java but faster to develop with is python still slower
then java?
Short answer: It might be.
Long answer: There are a lot of active libraries and frameworks out
their that attack common speed problems. For example numpy allows
C-type speeds of execution of some numerical applications. Note
its not fast if it is wrong, and Python may allow you to tune your
algorithm with more ease.

- Paddy.

May 19 '07 #33

P: n/a
I read in this thread lots of different (hopefully personal) opinions
on the question of Java vs Python,
so I thought I will post mines too (with the amendment that I am a
Java guy, spending there more than 10 years).

I don't think you can do a performance comparison upfront (without
having it completely flawed :-) ).
There are lots of important aspects that you need to take into
consideration while doing such a comparison
(startup time, gc configurability and performance, many many others),
and I think the only one that is fair is the one your would get for
your specific type of app.
And the same applies for the speed of development/maintenance/etc.

As with any other programming language: it has its own strong points
and weak points. This applies to both
Java and Python. And I don't think anybody on this list will be able
to tell you upfront which one is a better
fit for your app (at least not if they don't have an idea about your
environment, your existing pl knowledge,
your app, etc.).

bests,

../alex
--
..w( the_mindstorm )p.
Jul 15 '07 #34

P: n/a
Anthony Irwin a écrit :
Hi All,
(snip)
Also does anyone else have any useful comments about python vs java
without starting a flame war.
I guess I'd better not answer, then !-)
Jul 16 '07 #35

This discussion thread is closed

Replies have been disabled for this discussion.