News for hackers. Stuff that matters.
Re:Static Types Are for Perfectionists by bpshaver on Monday May 19, 2025 @03:09PM (#44033601)
Sometimes, but maybe you haven't written any tests! Type hints and immediate feedback from mypy are a lot easier than writing unit tests.
Re:Static Types Are for Perfectionists by igouy on Monday May 19, 2025 @04:41PM (#44034613)
> haven't written any

Any!

Then maybe the immediate feedback of consistent types conveys a false impression.

Re:Static Types Are for Perfectionists by bpshaver on Monday May 19, 2025 @07:06PM (#44035909)
Hard to conceive of a case where that would occur. Can you think of one?

The implication of what you're saying seems to be that if you're concerned about some kind of correctness you should be writing unit tests anyway and not being so fussed about type checking in a language like Python. I suppose if you are strictly following TDD that might work, but in all other cases type checks give you feedback much more quickly than unit tests ever can. I guess I don't understand.

Re:Static Types Are for Perfectionists by igouy on Monday May 19, 2025 @08:23PM (#44036461)
Any old math with consistent types and incorrect calculation? (If only we'd diff'd the output with some known result.)

No doubt we're at cross purposes.

I'm a little surprised that you haven't mentioned — "Program testing can be used to show the presence of bugs, but never to show their absence!" (or existential versus universal quantification).

Re:Static Types Are for Perfectionists by bpshaver on Tuesday May 20, 2025 @01:33AM (#44038111)
I'm afraid you lost me.