You're being downvoted because:
A) You left a comment with a strong opinion without expressing it while dismissing other peoples' experience B) Python is in fact a type safe language for a while now https://docs.python.org/3/library/typing.html - you have pluggable "a la bracha" types.
Well it has a typing mechanism, which is better than nothing, but has the mechanism been shown to be safe? C has types too, but I'm not sure that it would be described as type safe.
The research I've seen is basically:
- Take a class room of independently selected subjects (read: CS undergrad students).
- Give them the same coding problem in multiple languages or in the same language with or without compile time type checking.
- Measure the number of defects said programs have and hopefully draw a conclusion about the safety of the language.
All the research I've read on the topic has been pretty poor (though maybe I'm just bad at finding it).
Indeed there is no such research for typed Python (although the pluggalbe types research in general is great) but there is also no such research (that I've found) for Idris, ReasonML, Swift, Haskell, Rust or any of the usual "suspects" for "good types".
Please enlighten me :]
Sure there is. Strong typing means a language doesn't permit implicit type coercions.
> Any Haskell programmer would laugh at someone who calls Python strongly typed.
I'm sure lots of programmers are not particularly educated on the topic; it doesn't mean the word is 'nonsense'.
I definitely agree that it's not seeing nearly as much adoption as let's say... TypeScript in the JavaScript ecosystem though.
Facebook even wrote a package to generate types automatically for existing code https://github.com/Instagram/MonkeyType .
And that’s fine! Python is probably the best language in its niche. Type annotations just don’t do enough to break out of that niche. Annotated Python with mypy is a terrible statically-typed language. Python generally is an excellent dynamically-typed language.
I like the idea of type annotators but they do not make it a type safe language because types are not checked and they are more like comments.
Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention.[1]
It's still not really a sound type system, though. Many safe languages have some kind of escape hatch for the type system, but the escape hatches are very close at hand in Python's typing and you see them used several orders of magnitude more often.
Not that i like it but just to show that a lot of languages require a properly set up configuration and CI-infrastructure to make them safe and useful. mypy should be considered equal to -Wall -Werror and anyone who doesn't run it is frankly a bloody idiot.
It isn't, you're just contributing to a flamewar that has been going on since computers have been a thing.
See you at rehab!
"Better" is contextually dependent. There's no silver bullet to anything we do in tech.
Not necessarily. Python has a few huge advantages that aren't (directly) related to the quality or utility of the language. For example, hiring and training people to use Python is going to be easier and cheaper than hiring and training people to use C++. Additionally, as mentioned in the article, Python has a massive and healthy ecosystem of high quality packages.
And then there's the cost of porting an existing codebase to a new language...
https://www.salaryproject.com/salaries/company/netflix/senio...
how would the cases be better suited for a type safe language? what is type safety, in your opinion?