News for hackers. Stuff that matters.
Re:Reasons to avoid static type checking by roenxi on Sunday January 28, 2024 @02:06AM (#39163209)
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.

Re:Reasons to avoid static type checking by agubelu on Sunday January 28, 2024 @04:16AM (#39163838)
I 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.

Re:Reasons to avoid static type checking by jandrewrogers on Sunday January 28, 2024 @02:31AM (#39163313)
Strong 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.
Re:Reasons to avoid static type checking by galaxyLogic on Sunday January 28, 2024 @02:15AM (#39163246)
I 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.
Re:Reasons to avoid static type checking by mharig on Monday January 29, 2024 @06:08AM (#39175014)
There is such an equilibrium: type check API functions and do not clutter the rest of the code with type hints/declarations.