Sometimes when you're reviewing someone else's code, you find interesting pieces of "
art". Like the following loop construct in a C# application:
int i = anArray.Length - 1;
while (true)
{
if (i < 0)
break;
else
{
...
i--;
}
}
Doh.
You might be tempted to rewrite it as:
for( int i = anArray.Length - 1; i >= 0; i-- ) {
...
}
but it would be too simple, too boring, wouldn't it?