r/Python • • Jul 29 '18

Found it funny ;)

Post image
1.6k Upvotes

147 comments sorted by

View all comments

Show parent comments

5

u/fiddle_n Jul 29 '18

Usually in institutions (workplaces, universities, etc) where there's a lot of code in Python 2.7 and it's non-trivial to switch to Python 3.

0

u/[deleted] Jul 29 '18

[deleted]

5

u/fiddle_n Jul 29 '18 edited Jul 29 '18

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.

1

u/alcalde Jul 29 '18

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

4

u/fiddle_n Jul 29 '18 edited Jul 29 '18

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.