2 ms·
It doesn't just move errors to compile time. It moves runtime errors into the interface layer where you parse a request to bind it into your type so that by the
by BlackFly 2y ago
It doesn't just move errors to compile time. It moves runtime errors into the interface layer where you parse a request to bind it into your type so that by the time it reaches the persistence layer or something deeper you don't need to bubble up validation errors. You measure your invariants at the boundaries to provide safety to your interior code (defensive programming) and provide meaningful errors messages to users (developer experience).