Does Python compete with Java?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kk

    Does Python compete with Java?

    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.
  • Martin v. Löwis

    #2
    Re: Does Python compete with Java?

    kk wrote:[color=blue]
    > 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.[/color]

    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.
    [color=blue]
    > 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.[/color]

    Why is that important?
    [color=blue]
    > 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).[/color]

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

    Regards,
    Martin


    Comment

    • John Roth

      #3
      Re: Does Python compete with Java?

      "kk" <kkennedy65@yah oo.com> wrote in message
      news:8b336527.0 404051337.51bb4 a1b@posting.goo gle.com...[color=blue]
      > 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.[/color]

      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.
      [color=blue]
      > 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.[/color]

      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


      Comment

      • Roy Smith

        #4
        Re: Does Python compete with Java?

        "John Roth" <newsgroups@jhr othjr.com> wrote:[color=blue]
        > 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.[/color]

        Yeah, tell me about it. I've been playing around with some JSP stuff
        lately. Here's a method I wrote:

        protected void doLogin (HttpServletReq uest request,
        HttpServletResp onse response)
        throws ServletExceptio n
        {
        String name = (String) request.getPara meter ("name");
        String password = (String) request.getPara meter ("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 ServletExceptio n (exception);
        }
        catch (IOException exception) {
        throw new ServletExceptio n (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
        ServletExceptio n, 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.getPara meter ("name");
        password = request.getPara meter ("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)...
        [color=blue]
        > 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 IllegalHitByBul let
        > exception to be thrown, and you die.[/color]

        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.

        Comment

        • Harald Massa

          #5
          Re: Does Python compete with Java?

          Roy Smith <roy@panix.co m> wrote in news:roy-094613.21022405 042004
          @reader1.panix. com:
          [color=blue]
          > http://www-users.cs.york.ac.uk/~susan/joke/foot.htm[/color]
          [color=blue]
          >They don't have one for Python, but I expect it would be something like
          >this:[/color]

          I think the most common solution is:

          [color=blue]
          > How to Shoot Yourself In the Foot[/color]

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



          Comment

          • Peter Hansen

            #6
            Re: Does Python compete with Java?

            Roy Smith wrote:
            [color=blue]
            > 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.[/color]

            See Laura's excellent



            and also a whole thread from late 2001



            -Peter

            Comment

            • Peter Hansen

              #7
              Re: Does Python compete with Java?

              Peter Hansen wrote:
              [color=blue]
              > Roy Smith wrote:
              >[color=green]
              >> 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.[/color]
              >
              >
              > See Laura's excellent
              >
              > http://groups.google.com/groups?selm...e.mediaone.net[/color]

              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. :-(
              [color=blue]
              > and also a whole thread from late 2001
              >
              > http://groups.google.ca/groups?threa...e.mediaone.net
              >
              > -Peter[/color]

              Comment

              • Greg Ewing

                #8
                Re: Does Python compete with Java?

                kk wrote:[color=blue]
                > 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.[/color]

                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


                Comment

                • Erik Oomen

                  #9
                  Re: Does Python compete with Java?

                  Roy Smith wrote:
                  [color=blue]
                  > 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.[/color]

                  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.

                  Comment

                  • Chris Herborth

                    #10
                    Re: Does Python compete with Java?

                    Roy Smith wrote:
                    [... JSP example ...]
                    [color=blue]
                    > 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.[/color]

                    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)...
                    [color=blue]
                    > 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.[/color]

                    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 chrish@cryptoca rd.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.

                    Comment

                    • Chris Herborth

                      #11
                      Re: Does Python compete with Java?

                      Harald Massa wrote:
                      [color=blue]
                      > Roy Smith <roy@panix.co m> wrote in news:roy-094613.21022405 042004
                      > @reader1.panix. com:
                      >[color=green]
                      >>http://www-users.cs.york.ac.uk/~susan/joke/foot.htm[/color]
                      >[color=green]
                      >>They don't have one for Python, but I expect it would be something like
                      >>this:[/color]
                      >
                      > I think the most common solution is:
                      >[color=green]
                      >>How to Shoot Yourself In the Foot[/color]
                      >
                      > Python
                      > you discover that Guido used his time machine to shoot you in the foot
                      > years ago[/color]

                      My experience:

                      Post to comp.lang.pytho n:

                      "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 chrish@cryptoca rd.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.

                      Comment

                      • Jacek Generowicz

                        #12
                        Re: Does Python compete with Java?

                        Chris Herborth <chrish@cryptoc ard.com> writes:
                        [color=blue]
                        > 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[/color]
                        ^^^^^^^^^^^^^^^ ^^^^^^^^[color=blue]
                        > 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.[/color]

                        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.

                        Comment

                        • Roy Smith

                          #13
                          Re: Does Python compete with Java?

                          Chris Herborth <chrish@cryptoc ard.com> writes:[color=blue][color=green]
                          >> 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.[/color][/color]

                          Jacek Generowicz <jacek.generowi cz@cern.ch> wrote:[color=blue]
                          > 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.[/color]

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

                          Comment

                          • Peter Hansen

                            #14
                            Re: Does Python compete with Java?

                            Roy Smith wrote:[color=blue]
                            > 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 :-)[/color]

                            python -c "import py_compile as p; p.compile('mymo dule.py')"

                            Comment

                            • A. Lloyd Flanagan

                              #15
                              Re: Does Python compete with Java?

                              Greg Ewing <greg@cosc.cant erbury.ac.nz> wrote in message news:<c4taac$2l g0bc$1@ID-169208.news.uni-berlin.de>...[color=blue]
                              >
                              > 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.
                              >[/color]

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

                              Comment

                              Working...