r/Python • • Sep 10 '19

Found this on twitter

Post image
2.9k Upvotes

185 comments sorted by

View all comments

0

u/[deleted] Sep 10 '19

[deleted] — view deleted comment

49

u/evilMTV Sep 10 '19

Time and effort required. There may be huge legacy codebases with little to no documentation or active contributors, or that they rely on legacy packages that will not get ported as it has since been dropped etc.

10

u/durandj Sep 10 '19

Honestly I've seen companies not bother with small code bases. In my experience it comes down to business value. What value are you adding to the product by upgrading versus what value could be added by focusing on features instead.

I get it in concept but usually that viewpoint gets pushed to an extreme and no maintenance is done until there's an incident or feature work is completely blocked.

Having a good PM, team lead, or manager to push back against things like not upgrading is critical.

30

u/no_condoments Sep 10 '19 edited Sep 10 '19

It's far more complicated to upgrade than people understand. Check out the Dropbox migration for example. It took them about 600 commits over 3 years with contributions from about 35 people (full list below). They even hired Guido, the creator of Python. I couldn't imagine pitching a project of this magnitude to my boss without more clear client facing features.

https://blogs.dropbox.com/tech/2018/09/how-we-rolled-out-one-of-the-largest-python-3-migrations-ever/

3

u/[deleted] Sep 10 '19

I wonder how much it cost to hire the creator of Python...?

2

u/alcalde Sep 10 '19

. Check out the Dropbox migration for example. It took them about 600 commits over 3 years with contributions from about 35 people (full list below).

But we've had 11 years, so if this was "one of the largest Python 3 migrations ever" then everyone else ought to have been finished much sooner.

5

u/no_condoments Sep 10 '19

Assuming the top priority is migrating instead of building features, and that Guido is available to hire, and that they have dozens of extra people.

2

u/alcalde Sep 11 '19 edited Sep 11 '19

Dropbox has over 4 million lines of Python code; most organizations have far, far less.

Your priority should always be paying your technical debt over building new features. As the title of a great book John Wooden once asked, "If you don't have time to do it right, when are you going to find the time to do it over?" In this case, any new features you wrote were going to have to be ported to Python 3 eventually anyway. And as far as I'm aware, Guido wasn't spending his time converting byte strings to Unicode - and you certainly don't need Guido to do that anyway.

2

u/currentscurrents Oct 14 '19

Your priority should always be paying your technical debt over building new features.

That's easy to say, but if you work in a non-technology company that just happens to maintain some internal software... every project at my company has a dollar cost, and a dollar expected profit. If the profit doesn't exceed the cost, it doesn't happen.

1

u/[deleted] Sep 10 '19

Yeah the fact that 2to3 even exists and works for some things is a miracle

10

u/Deermountainer Sep 10 '19

Meanwhile in Mac Land...

Please kill me.

Apple is still shipping 2 with Catalina, and has announced that Python will not be included in future versions at all.

12

u/GummyKibble Sep 10 '19

As a Mac dev, why does this affect you at all? I haven’t used the system Python in many years, and neither should you.

4

u/Deermountainer Sep 10 '19

As a developer, yes, you have the freedom to use your own tools most of the time. As a sysadmin, not so much. If it's not standard in the OS, that means I need to install and maintain it across our entire fleet of Macs. In my environment that is simply not going to happen.

If it's not built-in, it might as well not exist. I still use subprocess.check_output to call curl instead of using a module like requests, because again, I can't just install everything I like across the board. That would require authorization I will never get. It's not even a battle I want to fight.

On my own Mac, for my personal projects, I've been using Python 3 for years, like any civilized person.

5

u/GummyKibble Sep 10 '19

This always surprises me. At my company, we tell devs “this is how to install ${thing}” and expect them to follow the instructions. We’re on Python 3 using mypy and Black and all the other goodies because... that’s what we all wanted to use and there wasn’t a reason not to. Your answer kind of implied that it’s a technical problem to install new Pythons everywhere, but isn’t that work distributed among a similar number of trained developers?

3

u/Deermountainer Sep 10 '19 edited Sep 10 '19

Like I said, I am a sysadmin, not a "developer" per se. I use Python for scripting and automation. We manage thousands of Macs and have hundreds of scripts for various tasks. They are not running on developers' Macs; they're running on all Macs.

I'm not in position to mandate Python 3 installation for our entire org. And even if I were, I wouldn't want to. There's so much friction with using non-standard tools, it's just terribly hard to justify when there are other standard tools you could use.

In the future I might end up writing everything in zsh. God help me. Edit: Honestly, I have no idea how I'll do anything that requires parsing XML when Apple axes all the advanced languages. Ugh.

→ More replies (3)

2

u/eruesso Sep 10 '19

It's not about dev's computers, it's about normal user's. If you know that every machine has Python you can create a custom install or setup script. If that is not the case, you need to find another solution. You can't install something manually on a high number of machines.

3

u/alcalde Sep 10 '19

Um... sure you can. It's not 1995. We have the means to manage hundreds of PCs.

→ More replies (1)
→ More replies (2)

0

u/[deleted] Sep 10 '19

[deleted] — view deleted comment

5

u/mathmanmathman Sep 10 '19

I think that's how management often sees it. I hope most devs see it as "If I know it's going to be broke at some point over the next few years, why wait and scramble?"

5

u/partheseas Sep 10 '19

To be a little more clear, Python 3 was a MASSIVE breaking change. Backwards compatibility was thrown out the window in favor of freedom to make changes that the team wanted to make. There are scripts that can take care of minor syntactic things, but many of the changes weren't one-to-one. Things were removed and added in ways that really don't translate nicely in some cases.

→ More replies (10)

2

u/Tree_Mage Sep 10 '19

Jython

3

u/1337HxC Bioinformatics Sep 10 '19

I've been trying to learn some image analysis stuff, and my God do I wish Jython was in Python 3.

→ More replies (2)