r/programminghorror • • Jan 12 '22

Python environment

https://imgs.xkcd.com/comics/python_environment.png

[removed] — view removed post

1.4k Upvotes

101 comments sorted by

View all comments

124

u/Instatetragrammaton Jan 12 '22 edited Jan 12 '22

How did it get to this? Furthermore - is just throwing each of these in a Docker container a viable solution?

Kind of strange for a language that has "there should be one— and preferably only one —obvious way to do it" as a design philosophy.

79

u/mortecouille Jan 12 '22

It got to this mostly because they made the terrible, terrible decision to make python 3 not backwards-compatible. Python 3 came out in 2008 and in 2022, we are now barely seeing the end of python 2, which was officially EOL in 2020.

In comparison, that is only 2 years after java 6, which has now been basically defunct for years already. Not that it's a problem, because if you do have old java 6 code, you can still compile and run it with any subsequent java version. This means that people can painlessly upgrade: if you depend on a library that is not using java (say) 8, your java 8 program can depend on it without issues. This was not true for python. As a result, if you wanted to write something using an existing library, you were bound by the willingness of that library to upgrade to python 3. To this day, there are still old libraries out there that have not been ported to python 3.

The maintainers made the mistake of believing every python developer was equally invested in the language as they are, and assumed people would jump to upgrade their projects to python3. Unsurprisingly, this did not happen.

1

u/aaronfranke Jan 12 '22

Breaking compatibility is not a terrible decision. The problem is that devs refuse to stop using Python 2.

Furthermore, it is totally possible to write software that is compatible with both versions.

7

u/mortecouille Jan 12 '22

You can't just introduce drastically breaking changes and complain that people are reluctant to upgrade. It can be a massive amount of work.

I write APIs and SDKs for a living. Incompatible changes aren't a thing you take lightly: we absolutely avoid them as much as possible, and for every breaking change, we provide a mitigation plan. Yes, that means that sometimes, if for instance there is a spelling mistake in an API method, it'll stay there. We might add another method with the right name, but the other one will just be deprecated, and redirect to the other call. We have people upgrading legacy systems from 5, 6 major versions ago, completely transparently.