Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Gadiguibou
on Nov 16, 2023
|
parent
|
context
|
favorite
| on:
Push ifs up and fors down
You can also often encode those checks in the type system like in the Option example near the start of the article.
RHSeeger
on Nov 16, 2023
[–]
Assuming your type system is robust enough to support such things. That's not the case for many mainstream languages.
sfink
on Nov 17, 2023
|
parent
[–]
In that case, use DEBUG-only asserts. They're not foolproof (they're only as good as your test suite), but they're pretty damn good.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: