3 ms·
Scepticism is warranted for partial type checking. Something I've noticed in partially-typed situations is they are the worst of all worlds. The type checker so
by roenxi 3y ago
Scepticism is warranted for partial type checking. Something I've noticed in partially-typed situations is they are the worst of all worlds. The type checker soaks up a lot of time, but the silly bugs that type checking would have caught still get through. Having 1 library that doesn't support type hints is a major problem if I'm trying to use a type checker.
Therefore, I think "... the authors have no desire to ever make type hints mandatory, even by convention." is useless. I'm sure the authors are honest about their desires, but frankly either everything gets type checked or practically nothing does. It is unlikely that there is a social equilibrium where some things get checked and some do not. Not only that, but clever libraries that aren't written with type checking in mind are often a devil to hint retroactively.
- galaxyLogic 3y agoI think there is a big difference in what we type-check. The interfaces of public methods should be declared and type-checked. What happens inside a function not so much.
- jandrewrogers 3y agoStrong agree that half-assed type checking is the worst of both worlds. Most of the effort of real type checking but only a fraction of the real-world benefit.
- agubelu 3y agoI agree with this. For example, it leads to weird situations where a linter with a strict type checking configuration marks some code as a type error, but it runs just fine. Which, in turn, leads to you ignoring type errors entirely, since you don't know which one are spurious and which ones aren't.
- mharig 3y agoThere is such an equilibrium: type check API functions and do not clutter the rest of the code with type hints/declarations.