by khazhoux · 2y ago · 0 comments
* My code doesn't work and I can't find the bug even after over an hour
* I add a few lines of <whatever code>. Now it works!
* Now, just for comparison, I remove all the code I just added (or, at least I think I reverted back to previous state). But now it still works.
???
Though it depends on the cause - as others in this comment chain said, if it's just that the file isn't actually being updated between tests, but adding a new line forces an update/recompile/etc., I'm not sure what you'd call it.
* The program works flawlessly
* Somebody finds a bug on the code that is executed in a test
* The relevant test now fails consistently
Both are probably because you changed something on the environment when you looked at the code.
Makefile (or a similar build system which uses timestamps) + a problem with wall clock -> stale files.