Wednesday, August 13, 2008

Are You Sure?

"There was a minor bug in one of my company's applications," Craig M wrote, "for whatever reason, it just hung after the 'Are you sure?' prompt."
 
"In an attempt to try and track down the problem, I popped my head into our UserInput class to ensure that the code was correctly validating the input. That's when I came across this..."
 
if (answer.equals("y")|| answer.equals("yes") || answer.equals("yep")) {
    return true;
}
if (answer.equals("ok")) {
    return true;
}
if (answer.equals("proceed")) {
    return true;
}
if (answer.equals("affirmative")) {
    return true;
}
if (answer.equals("positive")) {
    return true;
}
if (answer.equals("correct")) {
    return true;
}
if (answer.equals("aye")) {
    return true;
}
if (answer.equals("fine")) {
    return true;
}
if (answer.equals("yar")) {
    return true;
}

-- snip --"The list goes on, followed by another large list for a simple answer of 'no', totalling twenty-six possible answers. You've got to wonder the level of boredom required to make such an extensive list, and whether the developer in question really had nothing better to do."
(from thedailywtf.com)

No comments: