Live data from Hacker News

Sunsetting Python 2

python.org

611–620 of 733 posts

Re: Sunsetting Python 2

#611

Earlier quoted context omitted.

"Hey Joe, why did our customer database get leaked and published on a dark-net site?" "Hey boss, we're using an outdated programming language for which security updates are no longer provided, because we were told there's no budget for fixing technical debt." "Congratulations, you're fired." Same outcome either way... might as well make some effort to do the right thing along the way...

You’re confusing runtimes with the language. Py27 as a language has no security flaws that would allow a database to get leaked. People will continue to use py27 going forward with likely a pay-for-support runtime because that’s cheaper and less risky than changing a million lines of python code.

I would assume it’s the dependent libraries in your 27 project that no longer get support, not the language itself.

Re: Sunsetting Python 2

#612

Earlier quoted context omitted.

Cheers! Answering you for all three (at the moment) comments asking: Okay, here goes. In brief, Python 3 adds work without adding significant (to me) value. As others have pointed out, you don't get anything from converting an existing project from 2 to 3 other than compatibility with 3. If the Python 3 proponents were to succeed in killing 2 then that becomes compelling, however, since I intend to maintain 2, I don'…

One very high cost to staying on 2 will be that the pool of 3rd party modules you can draw from will continue to shrink as projects drop support for it. Sure, you can stay on Requests v.whatever, but eventually the SSL certs that it includes will expire, and then you'll have to maintain your own patched Requests with the new certs you want to use. Or eventually someone will find security problems with Django 1.11 LTS…

I get what you're saying and I think you're pretty much describing what it will be like. But honestly, I'm kind of looking forward to it. To me it's like maintaining a favorite model train set or something. A labor of love.

(Going forward I'm more likely to use Julia, Haskell or Prolog than Python 3 for new code.)

Re: Sunsetting Python 2

#613

Earlier quoted context omitted.

> By 3.6, it was markedly better than 2. Better how? Or better at what? It's likely that our opinions will be different but I've got an open mind and I'm genuinely curious about your experiences and opinion. (I hated PEP 572 at first but then some comment here on HN made me rethink and change my mind.)

f-strings. Enum. Dataclasses. asyncio. Type annotations as code. An explicit separation between bytes and strings. I love each of these and use them regularly. It's not that 2.7 is some abomination I can't stomach, but more that 3.[recent] is all of the things I appreciated about 2.7, plus a million little quality of life and performance enhancements that make it just that much more pleasant to use. I could live with…

I can understand that (it sounds like me, talking about Python 2, eh?)

Re: Sunsetting Python 2

#614

Earlier quoted context omitted.

I just realized I didn't answer your actual question, sorry. > what is it that you like about Python 2? I came from C and Pascal so from that POV Python is a rich and delicate syntactic and semantic gravy over the same basic functionality plus shell (Python was originally the shell language of the Amoeba distributed OS†). Things that might not seem that big a deal these days were a revelation to me when I started wit…

Thanks for your thoughtful responses!

Cheers!

Re: Sunsetting Python 2

#615
post #608
post #565

Earlier quoted context omitted.

I think it's less about the difficulty of manual changes and more about the cost to verify that all of the changes actually work. Dynamic typing on the language side, and a less than perfect test suite on the user side are not a good combination for large projects facing a project wide migration.

It's about risk. Python is a scripting language. That means that it's often auxiliary to a primary programming language. Your project might be in C++ but you use Python to package it or generate some assets, etc. Do you really care what language your auxiliary scripts are written in? No. Are you going to spend any amount of time converting them to Python 3 syntax? No. Your boss doesn't care, and you don't care. It wo…

Scripting is only one use of python, it's also a math language that is used for implementing servers, machine learning and statistical analytics, data processing pipelines, and more. Numpy/Pandas allows fast math operations because it makes python the interface for operations implemented on c-arrays underneath the surface. For many many people, python is the primary programming language. The ability to use the same language for scripting as for your primary application is part of the charm of python.

The existence of the cloud means that you can scale wide instead of scaling tall, which makes developer time and complexity management more valuable than hardware efficiency. Python is optimized for primary applications in exactly that kind of environment, where the performance characteristics of something like C++ don't make up for the clumsiness of the language.

Re: Sunsetting Python 2

#616

Earlier quoted context omitted.

Same situation here. Trying to jump on this bandwagon and finding it's a slithering target. I just wish they'd named it something different. If there's neither forward nor backward compatibility, I'd argue they're not the same language and should not have the same name.

Most languages have had breaking changes at some point in their history. Even the language known as "Perl 5" had them in almost every version.

In the real world, I've found Perl scripts written in 1999 (and poorly - as they were written by me in my teens) will still run in 2019. It's basically the policy that even language mistakes won't be undone:

https://perldoc.perl.org/perlpolicy.html#BACKWARD-COMPATIBIL...

Re: Sunsetting Python 2

#618
I'll never forgive the loss of the convenient print statement and easy string handling. So much for "practicality beats purity." At least most of the other new stuff is good.

Re: Sunsetting Python 2

#619

Earlier quoted context omitted.

> python 2 to 3 (at least by 3.3 or so) was one of the easiest transitions I've ever done. Good for you. Some of us had code bases of considerable size and complexity though. The fact is that for working software on the python platform, this upgrade represented work that had to be done that for a legacy app that was still chugging... little benefit. If you already coded around the python 2 limitations for Unicode eg,…

You've managed to say their analogy is bad in two paragraphs without even explaining why it's a bad analogy. You even admit you don't really understand what they were trying to say. Poor explanation, or poor understanding?

If an analogy requires more explanation than the original concept what purpose does it serve?

I think in this case at best the analogy grossly oversimplifies the issue. If it really were just a “screwdrivers” problem as explained then the 2 to 3 migration would have been mostly trouble free and would have happened. Clearly it did not go that way so that analogy can not possibly be appropriate.

Re: Sunsetting Python 2

#620

Earlier quoted context omitted.

> python 2 to 3 (at least by 3.3 or so) was one of the easiest transitions I've ever done. Good for you. Some of us had code bases of considerable size and complexity though. The fact is that for working software on the python platform, this upgrade represented work that had to be done that for a legacy app that was still chugging... little benefit. If you already coded around the python 2 limitations for Unicode eg,…

The tone of your writing is rude, unpersuasive, and lowers the level of discourse on the forum.

That’s like, your opinion, man.

I didn’t think it was the most amazing comment either, however, it was intended more to illustrate how things are rather than how they ought to be, I think some interpreted as a strong opinion in favor of the circumstances which was not intended. Based on how it scored (somewhat surprisingly) it clearly resonated with more than a few.

Post reply on HN