Voodoo Fix

A piece of ritualistic code discovered by trial and error which makes a problem "go away" for no apparent or logical reason.

Once a VoodooFix is discovered, it can often be recycled to get rid of (or at least disguise) a lot of other problems which don't bear any obvious connection to the one which first revealed the Voodoo.

Of course, using Voodoo is a bad idea because there is always a price to pay and you don't get to set the price.


In C and C++ a VoodooFix is usually just a rearrangement of code that causes the compiler to layout the code or the data differently in memory. Somewhere else in the program a pointer is being used to write into memory where it is causing code or data corruption. In the old version of the program it caused a particular bug to manifest itself. In the new program the bug has "disappeared" but really the symptoms have been moved to another part of the program.

In the good ol' days, all strange and illogical errors were caused by pointers. Now, they can be caused by either pointers or synchronization bugs or both. Four times the complexity! In the future, the interpreter will fail regularly as well, giving you nine times the complexity! Arrrghhhhhh.. -- SunirShah


Or you've put a printf into the code to try and find out what is going on. And now it works. So you take it out again. It stops working. At this point you can hear a little voice saying "Put the code down slowly and move away from the code" -- MatthewFarwell


See also: VoodooChickenCoding


EditText of this page (last edited November 29, 2005) or FindPage with title or text search