RE: Trying to choose between python and java

Discussion in 'Python' started by Hamilton, William, May 15, 2007.

  1. > From: Beliavsky
    On May 15, 1:30 am, Anthony Irwin <> wrote:
    >
    > <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.
    >


    No, they'll work just fine. They just won't work with Python 3. It's not
    like the Python Liberation Front is going to hack into your computer in the
    middle of the night and delete you 2.x installation.

    ---
    -Bill Hamilton
     
    Hamilton, William, May 15, 2007
    #1
    1. Advertising

  2. Hamilton, William

    Duncan Booth Guest

    "Hamilton, William " <> wrote:

    >
    > No, they'll work just fine. They just won't work with Python 3. It's
    > not like the Python Liberation Front is going to hack into your
    > computer in the middle of the night and delete you 2.x installation.


    Is that a breakaway group from the PSU?
     
    Duncan Booth, May 15, 2007
    #2
    1. Advertising

  3. Hamilton, William <> wrote:
    >> From: Beliavsky

    > On May 15, 1:30 am, Anthony Irwin <> wrote:


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


    The word is "deprecated." ("Depreciated" would be a financial term,
    not a term of art in computer science).

    >> Because Python 3 will change the syntax of print to disallow


    >> print "Hello, world."


    Python 3 is an exception case because it's the only time that the
    BFDL has specifically and intentionally declared that backward
    compability was NOT a goal for that version.

    Essentially you can consider Python 3 to be a fork ... a departure
    from Python 2.x and earlier.

    This specific change, for example, is intended to remove a
    consistency wart in the language. The "print" statement in Python
    is a special case. It's not a normal built-in function and it's not
    an expression.

    You can start writing all your code now as: print() --- calling
    the statement as if it were a function. Then you're future Python
    3 work would consist of simply defining a suitable function named
    print() (if one isn't provided or the one provided isn't suited
    to your needs).

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


    Python 3 will be a different language. It'll be similar, perhaps
    to the disruption between Perl 4 and Perl 5; or between Perl 5 and
    the proposed changes to Perl 6.

    Keep in mind that Java has had a number of features deprecated
    as well. The disruption from Java 1.x to Java2 and thence to Java5
    is probably greater than the level of disruption between Python 1.x
    and Python 2.5.x (which as been a roughly equivalent length of time
    --- over a decade in both cases).


    > No, they'll work just fine. They just won't work with Python 3. It's not
    > like the Python Liberation Front is going to hack into your computer in the
    > middle of the night and delete you 2.x installation.


    > ---
    > -Bill Hamilton


    Yes, considering this to be more like a fork then an upgrade is the
    wise approach. Many Linux distributions, for example, will probably
    ship and concurrently install Python 2.x and Python 3.x for a several
    years after Python 3 ships.

    --
    Jim Dennis,
    Starshine: Signed, Sealed, Delivered
     
    James T. Dennis, Jul 13, 2007
    #3
  4. James T. Dennis <> wrote:
    ...
    > You can start writing all your code now as: print() --- calling
    > the statement as if it were a function. Then you're future Python


    ....except that your output format will thereby become disgusting...:

    >>> name = 'Alex'
    >>> print 'Hello', name, 'and welcome to my program!'

    Hello Alex and welcome to my program!
    >>> print('Hello', name, 'and welcome to my program!')

    ('Hello', 'Alex', 'and welcome to my program!')

    In Python 2.*, the parentheses will make a tuple, and so you'll get an
    output full of parentheses, quotes and commas. I think it's pretty bad
    advice to give a newbie, to make his output as ugly as this.


    Alex
     
    Alex Martelli, Jul 16, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. freefly_xml
    Replies:
    4
    Views:
    859
    freefly_xml
    May 16, 2006
  2. Replies:
    11
    Views:
    583
  3. baibaichen

    choose between script and c++

    baibaichen, Nov 30, 2005, in forum: C++
    Replies:
    1
    Views:
    256
    mlimber
    Nov 30, 2005
  4. Anthony Irwin

    Trying to choose between python and java

    Anthony Irwin, May 15, 2007, in forum: Python
    Replies:
    34
    Views:
    842
    Bruno Desthuilliers
    Jul 16, 2007
  5. sogeking99
    Replies:
    1
    Views:
    237
    Brandon LaRocque
    Mar 6, 2011
Loading...

Share This Page