3 ms·
I mean, how would you possibly know about the type bugs that you didn't catch? I once ported a medium-size (ca. 5k LoC) python library to native C++, and we dis
by HotHotLava 6y ago
I mean, how would you possibly know about the type bugs that you didn't catch? I once ported a medium-size (ca. 5k LoC) python library to native C++, and we discovered a ton of latent type bugs that had stayed unnoticed in the code base for almost a decade. Things can randomly work for a long time due to duck typing, and then break in unpredictable ways.
Over time, this has a very noticable impact on development speed, and in a very painful way for the individual developers who need to spending your time tracing the various call paths in unrelated code and build up a mental model of the involved types every time they want to do a nontrivial change, and then deal with the fallout of unintentional bugs due to missed code paths for an unpredictable amount of time as they are discovered.
So when there is a solution that can completely eliminate this class of bugs in an automated way, this sounds like a very appealing feature.
- IgorPartola 6y agoI know because monitoring tools tell me when bugs occur, because exceptions are thrown. And I know because the code doesn’t run if you pass on a dict instead of an int. Statically typed languages have type systems that are by necessity strict but in a language like Python you don’t need to worry about whether your variable is a uint8_t or a uint16_t unless you specifically care about that. And more complex bugs like passing a list with the wrong number of members is not going to be caught by the type checker.
- HotHotLava 6y agoOnce a bug starts causing exceptions, it's no longer undetected. Then it becomes part of the post-deployment "fallout".
- Too 6y agoYou still need to worry whether an user_id-argument is int, str or maybe even uuid, though.
- david422 6y ago> Things can randomly work for a long time due to duck typing It's basically like they work by accident. It's not documented what goes in or goes out, so someone throws some data into a function and if it doesn't break then consider it success. And any future person that has to make a change has to untangle that whole mess.