does anyone have tips for reducing randomness in your programs while debugging? thinking of timing issues, random numbers, chaotic inputs, etc.

so far I have

- seed your RNG
- capture all input and run it a million times, and save the input once you find a version that fails
- use a record/replay debugger if you can (like rr)

Follow

@b0rk Reducing side-effects, complexity of interfaces between components, and multi-threaded components will reduce the odds of those issues and make them easier to debug.

If you don't have side-effects, and you're using RNG to test possible inputs, you can test *every* input from a single state, before advancing to the next one using a random input.

If your environment supports it, async/await helps a lot with building single-threaded code when you might otherwise need multiple threads.

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!