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

It's much better to have a `panic!("this should never happen")` statement than to let your program get into an inconsistent state and then keep going. Ideally, you can use your type system to make inconsistent states impossible, but type systems can only express so much. Even Haskell can't enforce typeclass laws at the compiler level.

A program that never asserts its invariants is much more likely to be a program that breaks those invariants than a program that probably doesn't.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: