3 ms·
I don't see this as either or. Good quality asserts can be very effective when managing objects with complex state transitions For me assertions are for invari
by pacaro 3y ago
I don't see this as either or. Good quality asserts can be very effective when managing objects with complex state transitions
For me assertions are for invariants. The code has no expectation of successful execution
I also like (borrowing from testing) the idea of expects, where we can hope that the object is in a specific state, but have an explicit compensation path for when it isn't, perhaps objects that need to be migrated to a new schema etc.