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

Does Python compete with Java?

P: n/a
kk
I read this mailing list fairly often, and I am always amazed at what
I learn (even not related to Python). I am relatively new to Python.
I make my living developing mostly in Java. Python was a "discovery"
I made a couple of years ago, and I love the language, but only get to
use it at home for hobbies.

With all the recent news:
- ESR tells Sun to open Java, or be relegated into obscurity by
Python, Ruby, and Perl.
- Project mono (C# compiler) is touted to be the next great thing in
Linux, and will be the dominate language. (by it's creator, of
coarse).
- This past weekend, Sun signs deal with devil (oops... Microsoft).
Now Java "openness" seems to have taken a very large step backwards!

I'd like to know if you guys think Python really has a chance to
compete with Java, .NET, and any other commercially backed language.

The reason I ask is I think it is important to have a "popular"
well-supported Open Source language to compete with the big players.
PHP seems to have some momentum in popularity, but I much prefer
Python as a language. Python has much to offer over Java, VB, etc...
Maybe the best chance it has is to ride on the coat-tails of .NET
(Python.NET) and the JVM (Jython). Interested to hear your comments.
Jul 18 '05 #1
Share this Question
Share on Google+
18 Replies


P: n/a
kk wrote:
I'd like to know if you guys think Python really has a chance to
compete with Java, .NET, and any other commercially backed language.
Python, by nature, does not compete: it is a product, and only
producers of a product can compete with producers of other products;
products never ever compete with one another (a product has no soul,
and no goal).

Whether the makers of Python compete with the makers of Java or
..NET is an interesting question, and one that is difficult to answer.
The makers of Python a free software developers, many of them
volunteers. The maker of Java is Sun Microsystems, the maker of
..NET is Microsoft. The Python makers have very different motivations,
and for some of them, competing with Sun may be a motivation - others
could not care less.

The same holds for the users: Some users of Python compete with
some users of Java, whereas others don't. This continues into education:
authors of Python books typically compete with authors of Java books,
except for authors of the Python tutorial, which likely don't compete
with anybody (except perhaps that authors of Python books have to
compete with the authors of the Python tutorial and other free
online documentation).

The mission of the Python Software Foundation is (among others), to
publicize, promote the adoption of, and facilitate the ongoing
development of Python-related technology and educational resources.
Whether or not that makes the PSF a competitor of Sun Microsystems,
I don't know.
The reason I ask is I think it is important to have a "popular"
well-supported Open Source language to compete with the big players.
Why is that important?
PHP seems to have some momentum in popularity, but I much prefer
Python as a language. Python has much to offer over Java, VB, etc...
Maybe the best chance it has is to ride on the coat-tails of .NET
(Python.NET) and the JVM (Jython).


If Python works for you, just go ahead and use it. Consider all
advantages and risks, and weigh for yourself.

Regards,
Martin
Jul 18 '05 #2

P: n/a
"kk" <kk********@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
I read this mailing list fairly often, and I am always amazed at what
I learn (even not related to Python). I am relatively new to Python.
I make my living developing mostly in Java. Python was a "discovery"
I made a couple of years ago, and I love the language, but only get to
use it at home for hobbies.

With all the recent news:
- ESR tells Sun to open Java, or be relegated into obscurity by
Python, Ruby, and Perl.
- Project mono (C# compiler) is touted to be the next great thing in
Linux, and will be the dominate language. (by it's creator, of
coarse).
- This past weekend, Sun signs deal with devil (oops... Microsoft).
Now Java "openness" seems to have taken a very large step backwards!

I'd like to know if you guys think Python really has a chance to
compete with Java, .NET, and any other commercially backed language.
That's an interesting question. I presume you mean for
market share in terms of the number of real projects, loc
and all that stuff.

At one time I would have said no, but recently some of the industry
gurus have been questioning whether the additional complexity of
static typing and other Java complexities is paying its weight as compared
to Python, especially when used in a TDD type development environment.

Another thing to consider is that while Sun has a lot wrapped
up in Java, Microsoft does not have the same attitude toward
C#. It may look like it, but their strategic direction would be
satisfied just as much by IronPython as by C# - both run on the
..NET platform, and as long as they take advantage of the native
libraries they will both do as well to lock the user into Windows.
And IronPython seems to be a pretty good performer; at least
as good as Python itself, and accordingly it beats Jython by quite
a margin.
The reason I ask is I think it is important to have a "popular"
well-supported Open Source language to compete with the big players.
PHP seems to have some momentum in popularity, but I much prefer
Python as a language. Python has much to offer over Java, VB, etc...
Maybe the best chance it has is to ride on the coat-tails of .NET
(Python.NET) and the JVM (Jython). Interested to hear your comments.


PHP has a considerable mindshare as "the language" to write
a certain class of web application. Beyond that, Perl is, I think,
the dominant scripting language, but it suffers from a perception
that it doesn't scale, and it isn't maintainable unless the development
team is very disciplined in adhering to a sane subset.

I think the next 10 years are going to see a huge shift in the
languages and tools we use regularly.

John Roth
Jul 18 '05 #3

P: n/a
"John Roth" <ne********@jhrothjr.com> wrote:
recently some of the industry gurus have been questioning whether the
additional complexity of static typing and other Java complexities is
paying its weight as compared to Python, especially when used in a
TDD type development environment.
Yeah, tell me about it. I've been playing around with some JSP stuff
lately. Here's a method I wrote:

protected void doLogin (HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
String name = (String) request.getParameter ("name");
String password = (String) request.getParameter ("password");
Connection connection = getDbConnection (request);

try {
LoginModel model = new LoginModel (connection);
boolean loginIsValid = model.validate (name, password);

if (loginIsValid) {
makeMainPage (request);
forward (request, response, "/main.jsp");
} else {
forward (request, response, "/badLogin.jsp");
}
}
catch (SQLException exception) {
throw new ServletException (exception);
}
catch (IOException exception) {
throw new ServletException (exception);
}
}

It's just filled with extraneous crap that's only there to make the java
complier happy and has nothing to do with the logic of my application.
The type declarations and casts are just the beginning. The interface
I'm inheriting from requires that the only exception I throw be
ServletException, so I need to catch all the others are re-throw.
Here's what the same logic would look like in Python, as a mechanical
transliteration:

def doLogin (request, response):
name = request.getParameter ("name");
password = request.getParameter ("password");
connection = getDbConnection (request);

model = LoginModel (connection);
loginIsValid = model.validate (name, password);

if loginIsValid:
makeMainPage (request);
forward (request, response, "/main.jsp");
else:
forward (request, response, "/badLogin.jsp");

13 lines of code instead of the original 26! This 2:1 ratio seems to be
pretty typical in my experience. It's not that I'm cramming more
application logic onto each line in the Python version, it's that I'm
getting rid of the fluff that takes up lines without adding anything
useful.

The end result is that it's harder to write, and the effort that goes
into making the compiler happy is that much less effort that I can put
into making sure I really understand how my application should be
designed, and testing it. It's a seeing the forest for the trees kind
of issue.

I think it's also a lot easier to read and understand the Python
version. Pretty much every line maps directly to the application logic,
with very little overhead.

Found on the web (http://www-users.cs.york.ac.uk/~susan/joke/foot.htm)...
How to Shoot Yourself In the Foot
[....]
Java
You locate the Gun class, but discover that the Bullet class is abstract, so
you extend it and write the missing part of the implementation. Then you
implement the ShootAble interface for your foot, and recompile the Foot
class. The interface lets the bullet call the doDamage method on the Foot,
so the Foot can damage itself in the most effective way. Now you run the
program, and call the doShoot method on the instance of the Gun class. First
the Gun creates an instance of Bullet, which calls the doFire method on the
Gun. The Gun calls the hit(Bullet) method on the Foot, and the instance of
Bullet is passed to the Foot. But this causes an IllegalHitByBullet
exception to be thrown, and you die.


They don't have one for Python, but I expect it would be something like
this:

You create a Foot object and call its shoot() method. The bullet makes
a hole in your foot, but by that time you've gotten dragged into a huge
flamewar about the relative merits of spaces vs. tabs for indentation
and barely notice the pain.
Jul 18 '05 #4

P: n/a
Roy Smith <ro*@panix.com> wrote in news:roy-094613.21022405042004
@reader1.panix.com:
http://www-users.cs.york.ac.uk/~susan/joke/foot.htm They don't have one for Python, but I expect it would be something like
this:
I think the most common solution is:

How to Shoot Yourself In the Foot


Python
you discover that Guido used his time machine to shoot you in the foot
years ago

Jul 18 '05 #5

P: n/a
Roy Smith wrote:
They don't have one for Python, but I expect it would be something like
this:

You create a Foot object and call its shoot() method. The bullet makes
a hole in your foot, but by that time you've gotten dragged into a huge
flamewar about the relative merits of spaces vs. tabs for indentation
and barely notice the pain.


See Laura's excellent

http://groups.google.com/groups?selm...e.mediaone.net

and also a whole thread from late 2001

http://groups.google.ca/groups?threa...e.mediaone.net

-Peter
Jul 18 '05 #6

P: n/a
Peter Hansen wrote:
Roy Smith wrote:
They don't have one for Python, but I expect it would be something
like this:

You create a Foot object and call its shoot() method. The bullet
makes a hole in your foot, but by that time you've gotten dragged into
a huge flamewar about the relative merits of spaces vs. tabs for
indentation and barely notice the pain.

See Laura's excellent

http://groups.google.com/groups?selm...e.mediaone.net


Oops! My apologies to Nick Mathewson, who actually wrote that.
I have a distinct, and clearly wrong, memory of it having been
authored by Laura Creighton. :-(
and also a whole thread from late 2001

http://groups.google.ca/groups?threa...e.mediaone.net

-Peter

Jul 18 '05 #7

P: n/a
kk wrote:
I'd like to know if you guys think Python really has a chance to
compete with Java, .NET, and any other commercially backed language.


It depends on what you mean by "compete".

Python is never going to have the same combination of hype
and money behind it as those other languages you mention.

But is that a bad thing or a good thing?

I think it's a *good* thing. Python is succeeding very well
by just existing and actually being well designed and useful,
as opposed to having a large company's marketing machine trying
to tell everyone that it is.

It sells itself to those who are willing to look. It doesn't
need or want any hype.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #8

P: n/a
Roy Smith wrote:
They don't have one for Python, but I expect it would be something like
this:

You create a Foot object and call its shoot() method. The bullet makes
a hole in your foot, but by that time you've gotten dragged into a huge
flamewar about the relative merits of spaces vs. tabs for indentation
and barely notice the pain.


Found this one at news.admin.net-abuse.email

Python
You shoot yourself in the foot and everything goes so smoothly that you
go ahead to to shoot yourself in the other foot then your legs, then
your torso and then your head. Problem solved.

Jul 18 '05 #9

P: n/a
Roy Smith wrote:
[... JSP example ...]
13 lines of code instead of the original 26! This 2:1 ratio seems to be
pretty typical in my experience. It's not that I'm cramming more
application logic onto each line in the Python version, it's that I'm
getting rid of the fluff that takes up lines without adding anything
useful.
I've experienced the same thing with the XML applications I tend to write at
work; the Python version is much smaller than the Java version, much easier
to read, and it was much easier to write. And tends to run about as quickly.

Strangely enough, I've had the same results with C# and .NET XML apps;
smaller, with less extraneous text in the code. And very fast. If Mono
and/or GNU Portable.NET were further along, I'd port my XML apps to C# (I
need to run on OS X and, eventually, Linux as well as Windows)...
The end result is that it's harder to write, and the effort that goes
into making the compiler happy is that much less effort that I can put
into making sure I really understand how my application should be
designed, and testing it. It's a seeing the forest for the trees kind
of issue.


One of Python's most awesome features (IMHO at least) is that you can fire
up an interactive interpreter while you're writing your code, and try things
out as you go... using this technique, I've unit tested methods and
algorithms interactively and ended up with useful, non-trivial applications
that run and work properly the first time.

With compiled languages (Java, C#, C++), I find I'm writing a bit of code,
taking a break to compile it, figuring out how to unit test the method...
Python saves me a huge amount of time in the prototype and development cycles.

--
Chris Herborth ch****@cryptocard.com
Documentation Overlord, CRYPTOCard Corp. http://www.cryptocard.com/
Never send a monster to do the work of an evil scientist.
Postatem obscuri lateris nescitis.
Jul 18 '05 #10

P: n/a
Harald Massa wrote:
Roy Smith <ro*@panix.com> wrote in news:roy-094613.21022405042004
@reader1.panix.com:
http://www-users.cs.york.ac.uk/~susan/joke/foot.htm

They don't have one for Python, but I expect it would be something like
this:


I think the most common solution is:
How to Shoot Yourself In the Foot


Python
you discover that Guido used his time machine to shoot you in the foot
years ago


My experience:

Post to comp.lang.python:

"I'm looking for a good scripting language, and Python's got some great
features, but that syntactically-relevant whitespace thing just seems wrong..."

Replies:

"Don't worry about it, in practice you'll see that you write code that way
anyway and it's very natural..."

Me:

"I don't know..."

[Wanders off for a few months. Returns.]

"Python rules! Best scripting language EVAR!"

--
Chris Herborth ch****@cryptocard.com
Documentation Overlord, CRYPTOCard Corp. http://www.cryptocard.com/
Never send a monster to do the work of an evil scientist.
Postatem obscuri lateris nescitis.
Jul 18 '05 #11

P: n/a
Chris Herborth <ch****@cryptocard.com> writes:
One of Python's most awesome features (IMHO at least) is that you can
fire up an interactive interpreter while you're writing your code, and
try things out as you go... using this technique, I've unit tested
methods and algorithms interactively and ended up with useful,
non-trivial applications that run and work properly the first time.
With compiled languages (Java, C#, C++), I find I'm writing a bit of ^^^^^^^^^^^^^^^^^^^^^^^ code, taking a break to compile it, figuring out how to unit test the
method... Python saves me a huge amount of time in the prototype and
development cycles.


Please note that this has nothing to do with compilation per-se. There
are languages with to-native-binary compilers which give you all the
instant turnaround flexibility that Python does.

Indeed, there are even some development environments for the languages
you mention which try to provide a similar experience.
Jul 18 '05 #12

P: n/a
Chris Herborth <ch****@cryptocard.com> writes:
With compiled languages (Java, C#, C++), I find I'm writing a bit of
code, taking a break to compile it, figuring out how to unit test the
method... Python saves me a huge amount of time in the prototype and
development cycles.

Jacek Generowicz <ja**************@cern.ch> wrote: Please note that this has nothing to do with compilation per-se. There
are languages with to-native-binary compilers which give you all the
instant turnaround flexibility that Python does.


Even more interesting is the fact that Java and Python both have very
similar architectures (similar enough, in fact, that things like Jython
are possible). Both compile your source code text into an intermediate
"byte code" form, and both then run this intermediate form on a virtual
machine.

The difference is that Java exposes the compilation step to the user
while Python hides it. If you really wanted to, you could hack up a
"Python compiler" which takes .py files, imports them to force
generation of the corresponding .pyc files, and then exits without
executing anything. You could then execute the .pyc files in a distinct
"execute phase". Not sure why you would want to do that, though :-)
Jul 18 '05 #13

P: n/a
Roy Smith wrote:
The difference is that Java exposes the compilation step to the user
while Python hides it. If you really wanted to, you could hack up a
"Python compiler" which takes .py files, imports them to force
generation of the corresponding .pyc files, and then exits without
executing anything. You could then execute the .pyc files in a distinct
"execute phase". Not sure why you would want to do that, though :-)


python -c "import py_compile as p; p.compile('mymodule.py')"
Jul 18 '05 #14

P: n/a
Greg Ewing <gr**@cosc.canterbury.ac.nz> wrote in message news:<c4*************@ID-169208.news.uni-berlin.de>...

I think it's a *good* thing. Python is succeeding very well
by just existing and actually being well designed and useful,
as opposed to having a large company's marketing machine trying
to tell everyone that it is.


Very true. In addition, I think python will gain a lot of
"mind-share" as more and more popular applications are written in
python.
Jul 18 '05 #15

P: n/a
> instance. Also, can "and", "or", "not" etc. be overloaded?

No one has said it yet, so here's my advice, check the operator module
for names you should call your 'overloaded' operators, the ones with
__name__ are ones that can be 'overloaded'.
http://www.python.org/doc/current/li...-operator.html

- Josiah
Jul 18 '05 #16

P: n/a
kk
I was responding to your point made earlier.

I was the one that started the thread, look again.

Peter Hansen <pe***@engcorp.com> wrote in message news:<5K********************@powergate.ca>...
kk wrote:
That is exactly my point!


Uh, sorry, but what point? The email address and initials you
are using here (kk********@yahoo.com and kk) have not posted
before in this thread, as far as I can see. So who are you? :-)

-Peter

Jul 18 '05 #17

P: n/a
kk wrote:

Peter Hansen <pe***@engcorp.com> wrote:
kk wrote:
That is exactly my point!
Uh, sorry, but what point? The email address and initials you
are using here (kk********@yahoo.com and kk) have not posted
before in this thread, as far as I can see. So who are you? :-)

I was responding to your point made earlier.

I was the one that started the thread, look again.


Ah, thanks. Mozilla had dropped the earlier messages, but Google
Groups helped me out.

And yes, I see that that was exactly your point. :-)

-Peter
Jul 18 '05 #18

P: n/a
> I would hope that someday Python would be a "tool" that "most"
developers would want to have in their "tool box".


The day "most" developers use Python is the day it stops being a
competitive advantage. ;)

Seriously, if you are starting a company with a good product idea in
mind, Python would be an excelent choice to get you going. (Wasn't a
certain search engine company started that way?)

-Ruben
Jul 18 '05 #19

This discussion thread is closed

Replies have been disabled for this discussion.