I find myself using a "splatter then clean up" technique when working with code.
I add a ton of prints/logs/asserts/type annotations until I've found the issue. I then throw them all away!
It feels like redundant work, but I don't have a nicer solution.
miniblog.
Related Posts
Print debugging remains an extremely common debugging technique. This makes me wonder: what's the state-of-the-art for print debugging?
Rust's debug! macro prints a bunch of helpful information (variable name, line number) but there must be other nice tools in this space.
https://build.rs/ is a handy Rust pattern for compile-time code generation. E.g. https://rust-lang-nursery.github.io/rust-bindgen/tutorial-3.html
It's a small standalone program that prints lines of Rust code! It reminds me of much more dynamic languages.