Trying to choose between python and java

B

Bruno Desthuilliers

Beliavsky a écrit :
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).
 
S

sjdevnull

Beliavsky a écrit :







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.
 
A

Anthony Irwin

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.
 
M

Michael Bentley

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
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
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.
 
A

Aahz

You're probably thinking of
http://www.gbch.net/gjb/blog/software/discuss/python-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...
 
M

Matimus

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
 
C

Cameron Laird

.
.
.
| #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.
 
S

sjdevnull

Cameron said:
.
.
.
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.
 
S

Steve Holden

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 ----------------
 
P

Paddy

Hi All,

Thanks to all that replied.
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.
 
A

Alex Popescu

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
 
B

Bruno Desthuilliers

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 !-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top