stumped

Okay, so I was reading through some old code of another programmer at my job a few weeks ago, and noticed something like this:

while (true)
{

//… some code here …
break;

}

I just shrugged it off, simply thinking he must have been on drugs when it was written, but then I noticed that he had used the exact same code in a project we are currently working on. For those not familiar with programming, the “while (true)” means keep doing the stuff inside the curly braces over and over, while the “break;” means to go ahead and stop repeating anything and go on to the next part of the program after the curly braces. I have tried to figure out what possible reason a while (true) statement with a break at the end would ever be useful, but it has me completely stumped. So either I’m not very bright, or I need to report a coworker for substance abuse.

0 Response to “stumped”


  • No Comments

Leave a Reply