I found this great example of how not to code at the Daily WTF (thedailywtf.com). Gave me a good laugh
if (what == 0) {
// Code Block A
}
else if (what == 2) {
// Code Block B
}
else if ((what == 1) || (what == 3) || (what == 5)) {
if (what == 1) which = 0;
if (what == 3) which = 1;
if (what == 5) which = 1;
}
// Code Block C omitted for sanity/brevity
if (what == 5) FooBar(position, 3);
else doWibble(position, what);
}
If what? Then which?! Send to FooBar(), else doWibble(). I love the programmer’s naming conventions!