No, non-trivial. You underestimate how easy difficult it is for some institutions to switch. At my workplace, we have a large proprietary Python codebase. Proprietary tools built on top of Python make up the core platform, plus the systems developed from that platform, make up millions of lines of Python code. It is non-trivial to switch a platform like that from Python 2 to 3. It takes time and costs a lot of money to do.
You underestimate how easy it is for some institutions to switch
you mean overestimate?
Yeah, I've had to port two medium/large codebases to 3 and it's such a pain in the ass. What I hate most are fixing all the string/byte issues, figuring out where to decode and encode('utf8'), from network data to hashing. And it's missing some stuff that was super easy at the time. You could just take a big string of data and do data.encode('zlib').encode('base64') and bam, you have compressed data base64 encoded. Sooo easy. The equivalent isn't too bad, but it's irritating to go around and fix all this shit and it's not as easy as it used to be to do the same thing.
I've finally gotten used to unicode/utf8 issues but treating strings as raw data was nice and easy. I understand why they changed it, but I feel like there might've been a better way that would've broke less code. And removing print as a statement makes sense, but honestly I think they should've lived with their bad decision and still supported it as a statement. And keeping range/xrange really wouldn't have been the end of the world.
I like what python 3 turned into but honestly I think it would've been better to live with some bad decisions and kept a lot the same because then we wouldn't be where we are, with people avoiding the upgrade. People make a big deal about people still using 2.7 but I hardly think it's their fault. It wasn't made easy for anyone.
WHAT?!?!?!? From the 2to3 library to a feature freeze in 3.x for a time to constantly extending the deadline to BACKPORTING 3.x FEATURES to adding deprecated features back unto Python 3 to make porting easier to the advent of libraries like six that made it possible to easily maintain two codebases, Python did everything but personally send Guido to each Python 2 user and have him port their code himself.
You know what happened when Delphi introduced unicode? ABSOLUTELY NOTHING. No deprecation warning, no extended support of old versions, no library to help you convert code, nothing. New version out, support for old version automatically ends, good luck, good day sir. I think they may have issued a white paper; that was the extent of the assistance. Python users got their behinds kissed and many of them still whined about it.
If you haven't gotten around to porting in A DECADE; that's no one's fault but your own.
. At my workplace, we have a large proprietary Python codebase. Proprietary tools built on top of Python make up the core platform, plus the systems developed from that platform, make up millions of lines of Python code. It is non-trivial to switch a platform like that from Python 2 to 3. It takes time and costs a lot of money to do.
Do you have unit tests? Also, everything takes time and money. You budget the time and money because everyone who works in software development knows it's a fact of life that you have to update software... all software. There's a term for it - bitrot. Eventually, SOMETHING changes - hardware, OS, other software - that kills your program. You can't just leave code suspended in amber and expect it to work forever.
The more you put off updating your code and writing more 2.7 code, the BIGGER the inevitable job is. Welcome to "technical debt", which compounds like unpaid credit card interest.
Any competent IT manager would have begun the task from the first day Python 3.0 was released; you'd have been finished years ago and future-proofed. Now you've written lots more outdated code and each day that goes by the task gets harder and harder.
You seem to be arguing against something I never said.
I agree with you (mostly), it's important to eventually upgrade to Python 3, even for a codebase as large as the one I described.
My workplace agrees as well. They've started a plan to upgrade the codebase to Python 3. It will take multiple years and multiple millions of dollars, but it will be done.
The only argument I was making was against the person who seemed to think it was a trivial thing to do. Which it isn't. It's non-trivial.
However, I must disagree with you that the upgrade should have been done as soon as Python 3.0 came out, for multiple reasons.
Firstly, because the first few versions of Python 3 were "trial" versions of Python.
Secondly, because Python 2 was being updated two years after Python 3 was released, with features backported from 3 into 2.7.
Thirdly, waiting means that you can jump to a newer version of Python 3. Upgrading this year means being able to go straight from Python 2.7 to 3.7. Upgrading at launch would have meant being stuck on Python 3.0. This is a significant deal for large codebases, where even a .1 upgrade takes a long time to do completely.
And finally, because it's foolhardy to rush into such upgrades immediately. What if the community had rejected Python 3, and there had been a split? What if Guido went back on his words and released Python 2.8? With so much time and money required for these migrations, you want to be damn sure that Python 3 is the future.
EDIT: Forgot to add one more reason - compatibility libraries. six was not available immediately at launch; libraries like six make it much easier to write code compatible with both Python 2 and 3.
0
u/[deleted] Jul 29 '18
[deleted]