by Qualadore · 4y ago · 0 comments
Maybe during debugging I consider the strategy of writing a minimal reproduction, but decide it's too time consuming. Then after reviewing the video, I can see that it would've been much faster if I had just written the reproduction to begin with.
Taking breaks does interfere with this, but I still think it's often a good idea.
Another strategy is to add assertions for your hypotheses, which can sometimes be preferable to logging.
I really learned to appreciate an abundance of asserts; the sooner you catch the issue, the less time you have to spend chase it around. Of course, asserts are in essence filtering the allowable state at a point and it's always more powerful when you can express that in the type system, which is why I love languages with rich static type systems, like Rust and Haskell.