News for hackers. Stuff that matters.
Re:What Have We Forgotten? by pjc50 on Wednesday January 29, 2025 @05:31AM (#42863485)
Yes, this always struck me as completely bananas. Types are a vastly superior form of test for certain conditions.

Duck typing with type inference would be nice but seems to be completely esoteric. You could have both the flexibility of being able to write "func(arg)" without having to specify the type, and the constraint that if you call arg.foo() in your function the compiler should enforce that you actually have a foo method on arg.

(special side-eye to the people materializing methods and properties all over the place at runtime. This seems to have been a rails/python thing that is gradually going out of fashion.)

There are no comments on this comment yet.