Here's a preview from my zine, The Pocket Guide to Debugging! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!
read the transcript!
It’s much easier to debug when your program does the exact same thing every time you run it.
Illustration of a sad stick figure with curly hair.
person (thinking): “the bug only happens 10% of the time, it’s SO HARD to figure out if my change fixed it or not.”
There are a bunch of tools for controlling your program’s inputs to reduce randomness, for example:
- many random number generators let you set the seed so you get the same results every time.
- faketime
fakes the current time.
- libraries like ruby’s vcr
can record http requests.
- record/replay debuggers like rr
record everything.
Saturday Morning Comics!
Want another comic like this in your email every Saturday? Sign up here!