3 ms·
There is no point in statically typed Python, it's useless. Just a lot of people from other programming languages coming in and trying to make the language mor
by ReflectedImage 4y ago
There is no point in statically typed Python, it's useless.
Just a lot of people from other programming languages coming in and trying to make the language more familiar to them.
- LtWorf 4y agoI moved from python2 to python3 to typed python3. It makes refactor much easier, I can easily understand what parameter a function wants, without having to read the docstring or worse, the body of the function. typecheckers do find a lot of errors that would otherwise be runtime errors.
- ReflectedImage 4y agoTyped Python code on average takes two times the time to develop and contains two times the number of bugs per delivered software feature. It's bad, really really bad. Refactoring can be done just as well via a good IDE and unit testing. Using typechecking creates far more errors then it finds. They are a necessary evil in compiled languages. It's been measured that it creates more errors. That is not open for debate.
- snapcaster 4y agoWhat is this based on? I have a lot of trouble believing untyped python code has half the bugs of typed code being someone who has written and read a lot of both
- ReflectedImage 4y agoActual measurements. I don't think you should be surprised. Untyped Python code is a lot shorter and more concise than typed Python code. The easiest way by far to reduce the bug count is to reduce the lines of code.
- snapcaster 4y agoThat's a good point I hadn't considered. where did you find these measurements?
- ReflectedImage 4y agohttps://games.greggman.com/game/dynamic-typing-static-typing/ https://games.greggman.com/game/dynamic-typing-static-typing...
- nequo 4y agoMaybe it's my daftness but where does this post say that typed Python has twice the number of bugs? It only seems to say that typed code takes longer to write and is longer. It doesn't seem to say that typed code has more bugs, nor does it compare typed Python with untyped Python.
- hbrn 4y ago> typecheckers do find a lot of errors that would otherwise be runtime errors. This is a claim I see repeated over and over without much evidence to support it. In my experience type checkers find a lot of errors that would still be found at later stages and a lot of tiny errors that don't matter and can be dealt with via much cheaper tools. Shorter feedback cycle is nice, and occasionally it does catch a real bug, but the benefits of static typing are vastly overblown. There probably are teams where typecheckers do catch a lot of important runtime errors. Those are the teams with a horrible engineering culture. In those environments typecheckers are a bandaid, not a cure. If anything, they are hiding the real problem: you shouldn't give a perfume to someone who doesn't shower.