my favorite if/else that I’ve seen in a while….
| December 23rd, 2008
if($state_check) {
$selected_state=$state_code;
} else {
$selected_state=$state_code;
}
… too bad $state_check was not defined…
if($state_check) {
$selected_state=$state_code;
} else {
$selected_state=$state_code;
}
… too bad $state_check was not defined…
Here’s a JavaScript function, buried deep within a 5000+ line JavaScript file with absolutely no documentation, let alone variables that might indicate what the function’s use is.
function checkCheck(ct) {
var v1;
var v2 = false;
var x;
for(x = 1; x <= ct; x++) {
v1 = $('check_' + x);
if(v1) {
if(v1.checked == 1) {
return true;
break;
}
else {
continue;
}
}
}
return v2;
}
Aside from the weirdness of the return/break/continue statements, v2 is never even used other than just to return false!
Have you ever come across a piece of code that is so horrible that it makes you want to scream? Have you ever wanted to smack a co-worker upside their head for employing horrible coding practices?
If so, then this is the site for you! We will feature the “Best of the Worst”, taking submissions from all over the world with your most horrible, mind boggling, stupid programming and development failures you’ve ever had the displeasure of gracing your monitor.
Welcome to devFAIL!