Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
teo_zero
on March 7, 2023
|
parent
|
context
|
favorite
| on:
Parse, don't validate (2019)
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.
PartiallyTyped
on March 7, 2023
[–]
Ah, you are right, i was under the impression that the compiler made it more specific.
My bad.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
It's the compiler that should warn you about a wrong type.