Re:Bracha v Felleisen “Types for an Untyped World” (2015) [v...
by crdoconnor on Saturday June 10, 2017 @11:01AM
(#14527580)
>I think you're confusing strong typing with type safety.
Check the wikipedia page for strong typing. Type safety is one of the ~11 or so different definitions. It's one reason I try to avoid using the term - because it's more emotional than meaningful.
>Static typing, on the other hand, completely eliminates the need for sanity type checks
You've not programmed in C have you?
I think you're confusing strong typing with type safety. Strong typing doesn't preclude errors; you just don't see the error until you hit the code, which might be all the time for a happy path, or almost never for an error path. Static typing, on the other hand, completely eliminates the need for sanity type checks (and depending on your language's notion of 'type' this can include virtually all forms of sanity checks).
> Type annotations are both unchecked and render any code that you write unusable in python 2
Static type checking is supported for both Python 2 and 3. If you need to write Python 2/3, you could probably just use the Python 2 annotations.
> Type annotations DO litter the code.
They don't. They're a small annotation that tells you what the variable actually is/does. Much neater than Sphinx docs, etc. And you do need to know the type, whether you like it or not.