The reason for most mysterious computer problems is precisely because computer programs follow precise logical pathway, even when a human wouldn’t.
Consider a program that wants to load an image. It expects the image to be stored in a file called image.jpg. It tries to load that file, but it doesn’t exist (maybe someone else deleted/moved/renamed the file). The program wants to load image.jpg. It tires to load the file, but it doesn’t exist. The program wants to load image.jpg. It tries to load the file, but it doesn’t exist… And so on.
A human would give up quickly on trying to load the image, or maybe try looking elsewhere. A computer will try forever. A lot of making code robust to bugs is explicitly telling the computer to be less deterministic. In this case, you would want code that, instead of saying “load image.jpg” says “Try to load image.jpg for 5 seconds, then give up.”
Latest Answers