back to article For real this time, get your butt off Python 2: No updates, no nothing after 1 January 2020

Python 2 will sunset on January 1st 2020 – however, many applications have not yet upgraded to version 3, causing the coding lingo's team to mount a communications campaign to persuade devs to port their code. Python is the third most popular programming language after JavaScript and Java, according to Redmonk. Its use has …

Page:

  1. Anonymous Coward
    Anonymous Coward

    Meanwhile at $JOB, still trying to get someone to care enough to give developers to update our Django 1.3, Python 2.6 sites to Python 2.7.

    20+ developers working on building the new shiny that doesn't quite replace the old site enough to actually turn the old site off, 5 doing maintenance on the ancient sites (but actually doing feature requests on the old sites). Every 6 months we mention this is coming, no-one high up wants to turn around to the business and say "actually we need to make sure that we aren't embarrassed by using such decrepit systems, so no new development for 6 months".

    1. ArrZarr Silver badge
      Unhappy

      My god, it's like looking in a mirror.

    2. J27

      Not surprising at all. The only 2 ways I know to do this sort of thing is for it to be horribly mission critical or to divert resources away from something else and secretly work on the update.

    3. DrXym

      We still have C++ source that has to conform to Visual Studio 2008 because it needs to be cross-compiled to a shitty Windows CE device through the ARM compiler. Fortunately that device has been discontinued so we might be able to upgrade to something better.

      But its all intertia - moving to VS 2019 means upgrading all the build machines, the installer, the distributables, doing a full regression etc. And that's without changing any lines of code. To actually change the code to more modern C++ or upgrading some of the 3rd party libs is another matter again.

      1. Tom 7

        I used to do some C/C++ ISAPI stuff and after a few upgrades and changes you learn what tends to be static and what changes and try and separate them in a coherent manner. I ended up re-writing it in VB so others could help (we had 30,000 customers and 300,000 products). It then got moved to VB.Net introducing a whole new set of issues including outsourcing woo hoo!

        I still feel that, given staff with experience, a good solid C++ 'stack' would be the best way to go, with some simple API to allow others to access data in the system.

      2. bombastic bob Silver badge
        Linux

        "Fortunately that device has been discontinued so we might be able to upgrade to something better."

        Got, LInux?

        1. DrXym

          We use Linux too for another device. The software is portable but it just can't use any features found in C++11 even though we use gcc on Linux to compile it - because of the other target which doesn't do C++11. Boost papers over some of the cracks but its still an issue.

    4. bombastic bob Silver badge
      Unhappy

      "still trying to get someone to care enough to give developers to update our Django 1.3, Python 2.6 sites to Python 2.7."

      Actually using Django... (and trying to maintain it!)

      You have my pity.

    5. Glen 1

      "Django 1.3, Python 2.6 sites to Python 2.7"

      TBF a Web Application Firewall (WAF) in front of that and you're fine.

      Keep that WAF up to date though...

      1. alauddinmondal

        Django makes great software

        I am new in python. I am using Django for my crm. I found python very flexible and secure. The most amazing thing is that it is very simple with oops concept. Any developer can make any software with this great language. More one thing is very interesting with the TKINTER module. I have created a text editor with this module. Very nice. Thank you!

  2. Anonymous Coward
    Anonymous Coward

    Can you explain?

    "...AI and machine learning, for which Python is well suited."

    Can anyone doing serious AI explain this? What makes it "well suited"? I always read this without anything backing it up. With so many alternatives this isn't "C is well suited for embedded" or "Windows is well suited for games" or "UNIX is well suited for networking"... this needs to be backed up with something.

    Python does need to move on I think. Not because of anything technical as im in the dark with Python there, but just because of the simple things like print("this") become annoying when any print routine should not need such attention.

    1. werdsmith Silver badge

      Re: Can you explain?

      Possibly to do with PyTorch or Tensorflow, it seems Python has been adopted for this sort of work in research.

      1. bombastic bob Silver badge
        Devil

        Re: Can you explain?

        Let's just all admit that Python, being an interpretive lingo with the capability of c language 'things' being called by it [not necessarily efficiently, check your loops] has about the same "power" as a SHELL SCRIPT or PERL SCRIPT that's pretty much doing the *same* *thing*...

        It may be a bit more convenient for the programmer than writing a few "filter" utilities to do things in C and spit output to the shell or Perl [which is then further processed as needed] but it's really the same *kind* of thing.

        And last I checked, shell (but not so much Perl, these days) has better BACKWARDS COMPATIBILITY

        Or you COULD just write it all in 'C'... yeah not THAT hard and once you get used to it, you'll say things like "why did I EVER use Python for THAT???"

        1. DCFusor

          Re: Can you explain?

          You must be thinking of "perl 6" which is going to get a new name, Bob. Perl is the most back-compatible language I've ever used in a very long programming career. GTK has been a bigger hassle going from 2 to 3.

          The python libraries that make it easier for non adept programmers really just do all the hard work in C anyway - python just makes it easy for those sorts to use C without knowing C. Which, as you point out, can be done lots of ways. I use the Inline::LanguageOfChoice per modules on cpan for that kind of thing fairly often.

          The best - and worst - things about python -

          Whitespace and indentation - nasty syntax, but it makes copy-pasta fail, which can't be bad.

          Duck typing which is just a little different from how every other Duck typing is done, making porting hard going either direction if code does anything where that matters. ( like all the bad device drivers for raspberry pies written in python)

          Poorly designed enough for this to even be an issue. Guido should have thought ahead more.

    2. J27

      Re: Can you explain?

      I think "popular in research circles" would be a more apt description. Mostly this is due to low barrier to entry.

    3. cdegroot

      Nothing new...

      It's not well-suited - it's slow at computation and basic string processing and heavily relies on libraries to keep up appearances. But, it's easy to learn for data scientists (which are usually not full-fledged computer programmers), has a very rich ecosystem in the area, and said data scientists like the workflow that things like Jupyter bring. So it's mostly an ecosystem thing, I guess started by Google (and everybody wants to do what Google does, for some reason). To me, running Python AI/ML in production is equivalent to running Excel sheets in production. Yes, it can be done. No, you probably don't want it.

      Alternative languages (like Julia) are trying to get a foothold in the space, personally I think that Common Lisp is much better suited (certainly from a performance standpoint), but "Python in AI/ML" is a bastion that will prove very hard to capture.

      1. Morten Bjoernsvik

        Re: Nothing new...

        >It's not well-suited - it's slow at computation and basic string processing and heavily relies on libraries >to keep up appearances.

        Python has also very easy bindings to C via Cython, We had a string splicing bottleneck. Since strings in python are immutable, splicing in larger strings are something you should avoid, but the code existed, it was easier just to rewrite the module calls in C using char pointers and the speedup was around 30X.

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          Tbh , if you're going to the trouble of wtiting a python library in C for your own use then you might just as well write the whole program in C or C++ and be done with it unless there's some very specific python functionality you need that is too much work to replicate in the former.

          1. Glen 1

            Re: Nothing new...

            Possibly, but the people writing the library are not necessarily the ones who will be using it.

            1. Anonymous Coward
              Anonymous Coward

              Re: Nothing new...

              Thats why I said "for your own use".

              1. Glen 1

                Re: Nothing new...

                'Thats why I said "for your own use".'

                Which could have meant your own companies use. (I admit, it didn't in this case)

                "might just as well write the whole program in C or C++ "

                Hey Guys! Boltar is volunteering to write a full web application in C or C++! Good Luck with that.

                As i've said elsewhere:

                "I'm paying someone to solve a problem, not to give themself a blowjob over how smart they are - that's how LISP happened."

                "Sure there are times when you *want* to juggle memory addresses, but a regular CRUD app? Nah. If there are performance issues somewhere down the road, there are several layers of abstraction to peel back before I start looking at (for example) C SELECT calls. That's commonly called "premature optimisation" is is frowned upon by those with a clue."

                --

                The above poster found a bottleneck, and solved it. They didn't "build the whole thing in C or C++" with the required (expensive) level of expertise and subsequent debugging issues. The resources were spent where they were measurably needed, not self flagellating about the tradeoffs of interpreted languages.

      2. dajames

        Re: Nothing new...

        ...and heavily relies on libraries to keep up appearances.

        Methinks that's a little unfair.

        There are four approaches.

        1. Freeze the language. Never add new features or capabilities. Watch it die.

        2. Keep the language itself stable, add new features via libraries. This is what Python does.

        3. Add features to the language itself whenever you think of a new feature, making the language more complicated, less consistent, and harder to learn.

        4. Do both of 3 and 4.

        You can't always avoid language changes when implementing new features as not everything can be expressed through a library API, but keeping the language stable as much as possible strikes me as a Good Thing(TM). The changes from Python 2 to Python 3 were made largely with the aim of making the language more consistent and logical, and easier to learn and understand.

        Keeping extensions in libraries rather than mucking about with the core language helps with the "easier to learn and understand" part.

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          "3. Add features to the language itself whenever you think of a new feature, making the language more complicated, less consistent, and harder to learn."

          The C++ approach. Which has now resulted in a language with a learning curve so steep I'd be amazed if anyone new to programming bothers with it after spending more than 5 mins looking at example code. And I speak as a C++ dev.

          1. DCFusor
            Coat

            Re: Nothing new...

            Yeah, I've done C since the first implementations of it, then C++ through MFC 4.2 when I did MS stuff at all - when DevStudio hadn't been "Visual basiced up" and there was no .NOT to attempt to "enhance Java" without the lawsuits. Around the time templates and the STD library (isn't that a disease you get from sex partners of ill repute?) - I quit using the new "features" in my own code and while I still write some C++, I mostly write plain C and call that from a glue language where the glue is quicker to write, but still fast in production.

            C++ "just grew" with patches on bandaids to the point of idiocy. Other languages do that high falutin stuff far better. Fine to write, but people complain about maintaining perl? Holy cow. As Damian Conway demo'd, you can write a Turing-complete implementation in the template system that compiles to no actual code, but runs a sort with output to sdtout while you wait!

        2. Psmo
          Go

          Re: Nothing new...

          Keeping extensions in libraries rather than mucking about with the core language helps with the "easier to learn and understand" part.

          Libraries and security patches can also have been back- and forward-ported for extra securo-goodness, while the entire Python interpreter has been embedded in other products as a macro language and removing or replacing any libraries with functionality you don't want.

        3. Jamie Jones Silver badge
          Happy

          Re: Nothing new...

          4. Do both of 3 and 4.

          ERROR: * Infinite loop causing repeated execution of point 3 detected *

      3. katrinab Silver badge
        Flame

        Re: Nothing new...

        "To me, running Python AI/ML in production is equivalent to running Excel sheets in production. Yes, it can be done. No, you probably don't want it."

        Running Excel sheets in production is something that happens very frequently.

        I just love taking over someone else's spaghetti-code of Excel formulae and macros.

      4. Anonymous Coward
        Anonymous Coward

        Re: Nothing new...

        | So it's mostly an ecosystem thing, I guess started by Google

        Nope. it's a dynamic language/REPL/Right level oi strong typing/Pythonic encapsulation thing that allows engineers and scientists to be productive in their field without needing to spend too much time as a programmer. Google know a good thing when they see it...

        1. Anonymous Coward
          Anonymous Coward

          Re: Nothing new...

          "llows engineers and scientists to be productive in their field without needing to spend too much time as a programmer"

          If these scientists and engineers are writing potentially safety critical AI production code they damn well BETTER be spending time honing their coding skills! Script kiddy level stuff is not good enough.

    4. Alan Bourke

      Re: Can you explain?

      It's very structured code-wise, and syntactically simple compared to {} languages. It's kind of the reason people used to use VB6 - it gets out of the way and lets you solve the problems. Data scientists don't want to be pissing around with the scaffolding involved in using other languages.

    5. Tom 7

      Re: Can you explain?

      Python can interface to the libraries that are generally written in C++ and being dynamic you can play with things easily.

      But then you can with something like BOOST!

      Python is programmings gateway drug but there have been many gateway drugs before and the real heroin still continues to grow in C/C++.

    6. Anonymous Coward
      Anonymous Coward

      Re: Can you explain?

      python is really good cos it's interpretive so it lets you run bits of it at a time and edit it quick like *really* quickly and it's got loads of libraries and stuff that let it talk to anything like even vulkan has a python interface to it so it's super awesome to make visualisations like *instantly* the moment you get the idea with shaders but it's super simple still to understand and you can make workbooks and then show in stages how you got data and worked it through and it's like combining a paper and the code that does it all at once together it's really good and slithery like that :V

    7. SolidSquid

      Re: Can you explain?

      Easier to use than a strongly typed language, the flexibility/range in terms of libraries, the embedded tool for checking code standards (pep8), the ability to write custom C-based libraries for it where speed is a deal breaker and being able to run in a Just-In-Time compiler/environment with high levels of compatibility where C isn't an option all make it an easier sell, especially since it means you don't have to learn a different language when you want to switch the kind of project you're working on

  3. Liam Proven Silver badge

    The fork is already out there

    It's Tauthon. (Tau is the Greek letter after Pi.)

    https://github.com/naftaliharris/tauthon

    Give it some attention. It may end up being a lot of people's only hope.

    1. thosrtanner
      Boffin

      Re: The fork is already out there

      The greek letter after Pi is Rho, and after then there's Sigma before you get to Tau

      1. Julian Bradfield

        Re: The fork is already out there

        Probably the reason is that τ is 2π - there are people who think that τ is a nicer fundamental constant than π.

        1. Fazal Majid

          Re: The fork is already out there

          Those people are wrong. The fact e^iπ==-1 shows π is the fundamental one.

          1. Aquilus

            Re: The fork is already out there

            no silly cos etothei'ing is the same as rotating something complex and so e^i tau = 1 makes much more sense cos that's just saying one rotation takes you back to where you started but e^i pi = -1 tells you one half-rotation takes you to the opposite point which alright yeah ok I guess also true but weird to care about enough to prefer it to be the canonical example of the identity :V

            1. Julian Bradfield

              Re: The fork is already out there

              But e^i tau = 1 doesn't tell you so much - if e^i 2pi = 1, then you know that e^i pi is +1 or -1, but not which.

          2. Anonymous Coward
            Anonymous Coward

            Re: The fork is already out there

            @Fazal

            Grasshopper, will you walk with me?

            https://tauday.com/tau-manifesto

            1. balrog

              Re: The fork is already out there

              Oh my I was so unaware that anybody else would share my interest into why π is used when 2π is more often a useful value. I am elevated, relieved and have achieved a zen like sense of inner calm. Thank you.

          3. Brangdon

            Re: e^iπ==-1

            You don't think that the -1 is a bit clunky? e^iτ=1. See https://tauday.com/tau-manifesto:

            Geometrically, multiplying by e^iθ corresponds to rotating a complex number by an angle θ in the complex plane, which suggests a second interpretation of Euler’s identity:

            A rotation by one turn is 1.

            Since the number 1 is the multiplicative identity, the geometric meaning of e^iτ=1 is that rotating a point in the complex plane by one turn simply returns it to its original position.

            As in the case of radian angle measure, we see how natural the association is between τ and one turn of a circle. Indeed, the identification of τ with “one turn” makes Euler’s identity sound almost like a tautology.

    2. bombastic bob Silver badge
      Coat

      Re: The fork is already out there

      in Greek, 'Pi' is actually pronounced "pee"

      So it's PEEthon now?

  4. cjcox

    How very PHP of them.

    Anyway, same old problems when people "in the name of good", create a lot of pain. Well done. Well done.

    1. bombastic bob Silver badge
      Meh

      Re: How very PHP of them.

      More like "How very MICROSOFT of them".

  5. JohnFen

    Dodged a bullet

    This makes me very happy that I've never used Python for anything important.

    1. This post has been deleted by its author

      1. JohnFen

        Re: 20 years is a lot of time.

        "Then why are they still using Python 2?"

        Because they have existing code written in it, perhaps? If you have to reengineer code just because there's a new version of the language, that's a pretty large downside of using that language.

        1. doublelayer Silver badge

          Re: 20 years is a lot of time.

          But you don't have to reengineer the code if you just want to keep running it. They aren't going to secretly break all of python 2.7. They just won't update it. So it is a lot like an old operating system, as you can't get support or security updates for Windows 98.

          For the comparisons to C, try taking C code from 1975 and compiling it and running it today. Likewise, see if you can get modern C to compile with the initial C compiler. In most cases, you'll be disappointed. However, a lot of it will work. And a lot of python 2 code can be picked up, without any changes, and run in python 3. If you have a sufficiently large codebase, it's likely that some changes will be needed, but you don't have to tear down and rewrite. Could they have done the changes differently? Sure, they could have. But it would not be significantly different, because things break. Languages change. They deprecate things in their standard libraries and introduce new ones. Python is not doing something that other languages have not done.

          1. Anonymous Coward
            FAIL

            Re: 20 years is a lot of time.

            > For the comparisons to C, try taking C code from 1975 and compiling it and running it today.

            GCC can compile K&R C today. K&R C being just about as far back as you can go with C, and it still being considered C.

            You can mix K&R C with C89 or C99 in the same executable or library. It just works.

            For example, there's a lot of K&R C code in bash.

            Yeah, K&R C is from 1978. That's 41 years ago. I was playing with spaceships and aliens in 1978.

            How long did it take Python 2 to become incompatible with Python 3? 7 years?

Page:

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like