Earlier quoted context omitted.
Citation heavily, heavily needed. Dynamic typing means that none of your code can be statically checked, which means that correctness relies on the exhaustiveness on your tests. It should be obvious that this would allow you to introduce more bugs, not fewer. Every program involves passing around data. When you need to change that data in a dynamic untyped language, you have no option but to manually test your whole…
[flagged]
Python's “disappointing” superpowers
141–150 of 264 posts
Re: Python's “disappointing” superpowers
#142Metaprogramming does not require dynamic types, but this post seems to equate them. As far as I can see all this could be done in e.g. Java (and probably is). IME this kind of "magic" very quickly loses its appeal when you have to debug it. The author's idea of libraries wrapping this stuff up so users don't have to care about it just doesn't pan out at all in my experience.
Fine! These things are based on metaprogramming; chances are you've used some of them.
* In nearly any language, nearly any ORM, for describing tables / models.
* In Rust, serde, and nearly everything you #[derive].
* In Java, Lombok, Hibernate, and most dependency-injection tools.
* In Java, most mocking / stubbing libraries.
* In Python, tons of stuff, from standard library (dataclasses, namedtuples) to various parts of Django, etc.
Judging by the sustained and widespread use of these things, they are not exactly complete failures.
Re: Python's “disappointing” superpowers
#143Earlier quoted context omitted.
> It's not a very strong claim, it's due to dynamic typing enabling the writing of more concise programs. The number #1 bug elimination tool is to simply write less code. It is a strong claim, it's also a very precise claim. Where do your numbers come from? Haskell and the ML family of languages also permit you to write much more concise programs than many other languages and they're definitely statically typed. How…
[flagged]
Here's my much better argument: Instead of using dynamic typing, eating babies reduces the incidence of bugs in code by 1000x. If you don't believe me and would like me to cite a source, you first provide a citation saying something different to what I'm saying and I'll provide my citations. Come on, you can do it! (Hint: You can't)
If it really was a strong claim, you could disprove it easily.
Re: Python's “disappointing” superpowers
#144Earlier quoted context omitted.
Citation heavily, heavily needed. Dynamic typing means that none of your code can be statically checked, which means that correctness relies on the exhaustiveness on your tests. It should be obvious that this would allow you to introduce more bugs, not fewer. Every program involves passing around data. When you need to change that data in a dynamic untyped language, you have no option but to manually test your whole…
[flagged]
So you can't even explain it, despite claiming to be experienced. Why should I listen to you? Your whole response is just you saying "First off, you're wrong. Second off, I'm right."
Here's a very simple example: I want to change a dict to a class. In untyped Python, how do you make sure that you make this change safely without introducing new bugs into your application?
Re: Python's “disappointing” superpowers
#145Earlier quoted context omitted.
[flagged]
Static typing is not just about code performance, it’s absolutely about correctness as well. I would really love to see that study as it flys in the face of all my experience
Re: Python's “disappointing” superpowers
#146Earlier quoted context omitted.
I support you ReflectedImage - seems like these people just don't know how great dynamic languages can be! My team has actually seen a 30x decrease in bugs, and a 50x increase in productivity ever since switching to Python.
Well a lot of people are claiming that static typing reduces bugs compared to dynamic typing, but I haven't seen from them a shred of evidence of this. When I go looking for myself what I found was studies saying that dynamic typing reduces development time by 2.5x and bugs per software feature by 2.5x. So perhaps one of these people claiming that static typing reduces bugs over dynamic typing, could provide the slig…
Re: Python's “disappointing” superpowers
#147I kinda hope we can just let Python be Python: it’s in a global-ish maximum for what it’s for, and I suspect any big move away from that will make it worse overall. Obviously things like UTF-8 support, or maybe getting a clean lexical scope option, or other “fixes” are good. Performance improvements are good. But there are lots of mainstream languages that have mature static type systems, strong metaprogramming facil…
Re: Python's “disappointing” superpowers
#148Earlier quoted context omitted.
> its datamodel is overally less of a hot mess compared to Javascript for example. I don't understand this, what do you mean? TypeScript is such a success partly because everything is an object in Javascript. There's no need to distinguish between classes and "dicts", as you have to with Python. Another example: Python functions have args and kwargs, which make typing significantly more complex (as the article points…
> everything is an object in Javascript Everything is an object in Python too. > There's no need to distinguish between classes and "dicts", as you have to with Python. "dict" in Python (or at least Python 3, but Python 2 is EOL now so Python 3 is the only active Python there is) is a class. You can even subclass it, which if you want a customized dict for some reason in your particular application is often the best…
Ah yes, true. JavaScript goes one step further though, and has no distinction between get-item accesses and attribute accesses. This makes TypeScript's data model much simpler to manage. Is it even possible to implement your own `MutableMapping` or `dataclasses` equivalent type in Python? I know the latter requires custom plugins.
Re: Python's “disappointing” superpowers
#149Re: Python's “disappointing” superpowers
#150All these features are nice and stuff... But they are often runtime features... At compile time Python doesnt tell you wether a program is correct. Which is fine for small programs or small services. But any big system is written in python is really hard to maintain without LOTS of unit tests... Static typing, compile time checks just win in the long run. And with languages like kotlin you still have all the advantag…