News for hackers. Stuff that matters.
Re:The Compiler Is Your Best Friend, Stop Lying to It by bccdee on Thursday January 01, 2026 @02:57PM (#46457445)
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.

There are no comments on this comment yet.