Skip to content

Comment on Assert in Productionparent

Comments

Yes, exceptions often surprise us in practice. The distinction I'm drawing is more about categorical boundaries than anticipated boundaries: exceptions are part of normal control flow, they are catchable and can be handled. Assertion violations are different: if an invariant is violated, no subsequent action should be trusted.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.