News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by teo_zero on Tuesday March 07, 2023 @08:36AM (#35055148)
If foo() happily accepts a number instead of a Prime, then this is not robust enough: you can always forget the check!

It's the compiler that should warn you about a wrong type.

Re:Parse, Don't Validate (2019) by PartiallyTyped on Tuesday March 07, 2023 @10:32AM (#35056440)
Ah, you are right, i was under the impression that the compiler made it more specific.

My bad.