Re:Python 2 Removed from Debian
by groestl on Tuesday January 03, 2023 @02:18AM
(#34228766)
The string/bytes encoding lead to some weird runtime problems in a codebase I maintain (the quality of which is probably not that great to begin with). Also changes in non-statically compiled languages will always be a bit tricky. In general, a comprehensive unit test suite is required to step in for the compiler, otherwise there's no confident refactoring. But python is sooooo ubiquitous it's crazy, and most code does not have unit tests to make up for missing compile time checks. The codebase I mentioned earlier certainly doesn't.
[ Parent
| on HN ]
Re:Python 2 Removed from Debian
by erik_seaberg on Tuesday January 03, 2023 @03:34AM
(#34229223)
I’m pretty cautious about changing my own code, but even I am not paranoid to write tests to verify that freakin’ strings still have the behavior I rely on.
At least not until the day they suddenly didn’t.
Yes, and that's one reason why a static compiled type system helps you maintain code, dependencies and language I'd say.
I tried adding type hinting to a program that I had to maintain once - because it had no unit tests and I was looking for the quickest way to make it less fragile. One tended to make a small change and then find that it broke something somewhere but finding that out was a long process.
FWIW I found it nearly useless - whereas biting the bullet and refactoring it so that it could be unit tested - even just a few tests - made a world of difference.
Re:Python 2 Removed from Debian
by nibbleshifter on Tuesday January 03, 2023 @03:59AM
(#34229401)
> At least not until the day they suddenly didn’t.
That's been happening more and more recently to me. Python 2 really was lax about letting you mix types and get shit done fast, but Python 3 is a different beast entirely. Really opinionated.
Re:Python 2 Removed from Debian
by nibbleshifter on Tuesday January 03, 2023 @03:55AM
(#34229380)
The string/bytes thing is one of the issues that has been kicking my ass with older codebases.
Oftentimes there's... Bodges and hacks that made shit work that I never documented.
Re:Python 2 Removed from Debian
by erik_seaberg on Tuesday January 03, 2023 @04:01AM
(#34229414)
As Red Green assured us, “this is only temporary … unless it works.”