From time to time people complain that an error happens "randomly." This is understandable coming from a user without a technical background, but coming from a programmer it’s nothing short of self-deceptive. Those who want to fix bugs instead of giving up on them or blaming them on someone else’s mistake would do well to avoid this mindset.
True randomness on a computer is remarkably difficult to achieve. [PDF] Short of hardware thermal failure, it’s highly likely that the bug you are seeing is not at all random, but rather is the result of a complex series of interactions which you don’t yet fully understand. The first step is to acknowledge the problem which is preventing you from fixing the bug: "I don’t yet understand why this happens when it does."
Once you’ve done that, you may discover that your investigations become much more productive. Instead of presuming that there is no pattern to the bug occuring, you start asking yourself what could cause such a problem. Instead of presuming that system libraries are magical black boxes with unknowable mysteries inside, you’ll start asking how you can trace the problem outside of your own code.
Calling a bug "random" is giving up on the very investigations which will eventually solve the problem.
{ 5 } Comments
I have many times found the *solution* (or workaround) to "random" bugs without knowing the actual cause (psychic powers), but the bits of knowledge help a lot
yesterday for example we were getting a "A call to an OS function failed" error, on an ActiveX control (written in Delphi, that I didn’t have the source code for), having a bit of background knowledge on this problem I started asking questions about when this was happening and having the person go through it and making it fail, and making it work correctly
the program was working fine in any other machines with the same exact specifications as the problem machine, same version of windows (XP), latest patches and everything
after a few minutes I suggested to run the ActiveX in full screen, problem solved =o)
is not always (in fact many times is not) easy to identify what causes a problem but you have to try different things at least
Thanks, Eber, that’s a point worth clarifying.
I don’t mean to suggest that you will always be able to identify the precise cause of a problem. Sometimes it’s too complex to understand completely, or there are factors you’re simply unaware of. I just mean that there is a difference between saying "I don’t understand everything involved here," which acknowledges the limits of your knowledge, and "It’s random," which implies that there is nothing further to know.
sure, those are the same programmers (in the case of the programmers) that use the infamous "but it works on my machine!"
On my computer everytime I go to enter a website it says "An error has occured on this script. Do you want to continue?And I always cancel out cause if I say yes it takes 5 or 6 times til it will continue on to the website I want. Im trying to get rid of them cause they shouldn’t be coming on at all. Thank You
"dstewart1," install Firefox (http://www.getfirefox.com) and make it your default browser. You’ll never see that error again.
Post a Comment