3 ms·
> useless complexity that yield little return Typechecking allows certain errors to be detected at typecheck time rather than at runtime. I don't personally c
by retrac 5y ago
> useless complexity that yield little return
Typechecking allows certain errors to be detected at typecheck time rather than at runtime. I don't personally consider that useless. E.g. A mistake I just made. I'm working in a language I don't know too well right now with strict static typing. The file read function takes a handle. If I pass it a string of the file name, rather than the handle result from file open, it just doesn't compile. In most dynamic languages, that error would not be detected until it executes.
- ReflectedImage 5y agoThe changes you need to make to a Python program to enable it to be type checked result in more bugs being added than the type checker removes leaving you at a net negative. Type checking is just a really poor way to ensure program correctness until you start using an exceptionally strongly typed language like Haskell. You use types in C / C++ / Java because the compiler needs them to work not because it's a good idea.
- mjr00 5y ago> The changes you need to make to a Python program to enable it to be type checked result in more bugs being added than the type checker removes leaving you at a net negative. This claim doesn't make sense to me. Assuming mypy is regularly run as part of CI, why would adding type annotations cause more bugs than leaving it off?