4 ms·
There's a lot of code out there that's important, but not worth porting to a new language (which Python 3 is).
by downerending 7y ago
There's a lot of code out there that's important, but not worth porting to a new language (which Python 3 is).
- acdha 7y agoI think describing it as porting to a new language is misleading: on most of my projects, most of the work is a few minutes — run modernize/futurize, check the tests, etc. If the original developers were really sloppy about how they handle encoding, it can take longer but most of the problems I've seen have very little to do with Python rather than the fact that something still running Python 2 likely has significant technical debt issues — especially things like not having test coverage which make it a lot harder to ship changes.
- downerending 7y ago> likely has significant technical debt issues You're not wrong, but as a practical matter, that pretty much describes our entire industry.
- acdha 7y agoCompletely agreed — I would just argue that the “Python 2 vs. 3” argument is a distraction. Java hasn't had as breaking a change but there are still a ton of places running Java 6 or 7 because they like skimping on developers more than getting security updates.
- Joeboy 7y agoOur product took about a year to port, from getting the go-ahead to the eventual production switch. Running modernize / futurize was like 0.01% of the work. You're right though, we're fighting our way out of technical debt and switching to python 3 was absolutely necessary. It's forced us to sort out a lot of sketchy string / bytes handling. We do, mercifully, have ~90% test coverage.
- abiogenesis 7y agoA year is astronomical. Does it involve writing tests that did not exist before?
- Joeboy 7y agoI don't remember us writing any new tests specifically for the python 3 port. One issue with the test suite was that it made heavy use of a thing called django_any that isn't supported in python 3, so decided to replace it with Factory Boy. We have about 500 django models that needed new factories. Factory Boy works quite differently and it was a lot of work to make the factories behave similarly to the old ones where possible, and update most of our ~4000 tests for the new behaviour. So that was one issue. It was tempting to just patch django_any, but we decided to tackle the technical debt instead.
- MattGaiser 7y ago> something still running Python 2 likely has significant technical debt issues Most codebases basically.