3 ms·
Yeah, that's how I see it. I try to code small, assertion-like "invariants" into my programs via guard clauses and... assertions. When I get an error, it's usu
by catapart 3y ago
Yeah, that's how I see it.
I try to code small, assertion-like "invariants" into my programs via guard clauses and... assertions. When I get an error, it's usually handled by those, so I pop open the debugger, break on the exception and trace the stack back to see where I should have had a higher-level assertion or guard clause.
Invariants to make debugging fast and easy (and to force me to write better code in early, malleable stages), debugger to show me exactly where I wasn't thinking it through.