Call it confirmation bias, call it superstition, but as developers and human beings, we're all susceptible to it. Say you're working on a particularly tricky bit of code, so you've fallen back on the "try all kinds of crazy crap until it passes the specific test case" method, an invaluable tool for all developers. You find an approach that works, and while you're not sure exactly why it worked, you keep it in mind for the future.

In Robert L.'s case, he found the snippet below:

this.rect.X1 = Math.Min(this.rect.X1, this.rect.X1 - 0);
this.rect.X2 = Math.Max(this.rect.X2, this.rect.X2 + 0);
this.rect.Y1 = Math.Min(this.rect.Y1, this.rect.Y1 - 0);
this.rect.Y2 = Math.Max(this.rect.Y2, this.rect.Y2 + 0);

Presumably, the developer made a whole bunch of changes, including the adding/subtracting of zero, and some change outside this code fixed the bug. "Oh well," he must have reasoned, "it worked for X1, might as well do this for the other coordinates."

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!