Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can also often encode those checks in the type system like in the Option example near the start of the article.


Assuming your type system is robust enough to support such things. That's not the case for many mainstream languages.


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: