Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a citation if it makes you happy: https://games.greggman.com/game/dynamic-typing-static-typing...

2% of bugs can be caught via static typing.

For your very simple example, your IDE can do that!



Here is a study that show Python is more bug-prone and that TypeScript is far more reliable: https://danluu.com/empirical-pl/

That source shows why language studies are so difficult, and why it is hard to draw conclusions. For example, your study doesn't count KeyErrors or NoneType exceptions as type errors, but those count as well. There are other considerations: you're only looking at released projects which might have a ton of tests to balance the fact that they're dynamic. But there is absolutely no way you can say "dynamic languages are less buggy". There's no data for that.

> For your very simple example, your IDE can do that!

No it can't. An IDE doesn't help at all here, because it doesn't know where you passed around that dict, and where it was created. There's no type hints. That dict is now a class, and you have to go find where else you used it. If you don't use any type hints in Python, how would you find all those cases? You have to hunt for it yourself, grok the entire codebase (which you may not have worked in for a while), and then run it a ton of times to make sure you caught every edge case. Refactoring in Python is very time consuming and dangerous compared to typed languages.


[flagged]


That is the most brazenly false statement I've ever heard. "Python is superior due to dynamic typing, and also all types in Python can be statically inferred!" Wow, you should let them know that type hints was a total waste of time because you could already infer them!

I think it's clear you have a very weak understanding of this topic, and you have no interest in having a civil conversation. Good night!


You have clearly made up your mind and no matter what someone says you won't change it. Good luck learning new skills.


Well I'm showing evidence for my position and no one else is. My mind could be changed with evidence. But there isn't any as I'm correct.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: