Click here to Skip to main content
15,886,693 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: I have no name, I don't exist Pin
Jörgen Sigvardsson12-Jun-09 6:47
Jörgen Sigvardsson12-Jun-09 6:47 
GeneralQuantity FTW! Pin
Brady Kelly28-May-09 22:15
Brady Kelly28-May-09 22:15 
GeneralRe: Quantity FTW! Pin
Tristan Rhodes28-May-09 23:32
Tristan Rhodes28-May-09 23:32 
GeneralRe: Quantity FTW! Pin
Ian Shlasko29-May-09 10:16
Ian Shlasko29-May-09 10:16 
GeneralRe: Quantity FTW! Pin
Jörgen Sigvardsson12-Jun-09 6:50
Jörgen Sigvardsson12-Jun-09 6:50 
GeneralRe: Quantity FTW! Pin
Brady Kelly12-Jun-09 6:53
Brady Kelly12-Jun-09 6:53 
GeneralRe: Quantity FTW! Pin
Jörgen Sigvardsson12-Jun-09 6:55
Jörgen Sigvardsson12-Jun-09 6:55 
GeneralQuantity, not quality PinPopular
ClementsDan28-May-09 14:25
ClementsDan28-May-09 14:25 
I found this function in the service I'm having to debug. I've omitted a few hundred lines of the code so that you may more clearly see the control flow.

void ProcessMessage()
{
   if ( )
   {

   }

   if ( )
   {

   }

   if ( )
   {

   }

   if ( )
   {

   }

   while ( )
   {
      if ( )
      {
         continue;
      }

      if ( )
      {
         continue;
      }

      if ( )
      {
         continue;
      }

      if ( && )
      {
         if ( || )
         {
            if ( )
            {

            }
            else
            {

            }

            continue;
         }
      }

      if ( )
      {
         continue;
      }


      for ( ; ; )
      {
         if ( )
         {

         }

         if ( )
         {
            if ( )
            {

            }

            continue;
         }

         if ( )
         {
            if ( )
            {

            }

            continue;
         }

         if ( )
         {
            if ( )
            {

            }
            else
            {

            }

            if ( || || ( && ))
            {
               if ( )
               {

               }
            }
            else
            {
               if ( )
               {

               }
            }

            continue;
         }

         if ( )
         {
            for ( ; ; )
            {
               if ( )
               {
                  continue;
               }

               if ( )
               {
                  if ( )
                  {

                  }
                  else
                  {

                  }

                  if ( )
                  {

                  }

                  break;
               }
               else if ( )
               {
                  if ( || )
                  {
                     if ( )
                     {
                        if ( )
                        {

                        }
                     }
                  }

                  if ( )
                  {

                  }
                  else
                  {

                  }

                  continue;
               }
               else
               {
                  if ( )
                  {

                  }

                  break;
               }
            }
         }
         else
         {
            if ( )
            {

            }
         }

         if ( )
         {
            if ( )
            {

            }
         }
         else
         {
            for ( ; ; )
            {

            }
         }

         if ( || || )
         {
            if ( )
            {

            }
            else if ( )
            {

            }
            else
            {

            }

            if ( )
            {

            }
            else
            {
               if ( )
               {

               }
               else
               {

               }

               if ( || ( && ))
               {
                  if ( )
                  {
                     if ( )
                     {

                     }
                     else
                     {

                     }
                  }
               }
               else
               {
                  if ( )
                  {
                     if ( )
                     {

                     }
                     else
                     {

                     }
                  }
               }
            }
         }
      }

      for ( ; ; )
      {
         if ( )
         {

         }
      }

      if ( )
      {
         if ( )
         {

         }

         if ( )
         {
            if ( )
            {

            }
         }
         else
         {
            if ( )
            {

            }
         }
      }
      else
      {

      }
   }
}

GeneralRe: Quantity, not quality Pin
Robert Surtees28-May-09 17:07
Robert Surtees28-May-09 17:07 
GeneralRe: Quantity, not quality Pin
OriginalGriff28-May-09 21:22
mveOriginalGriff28-May-09 21:22 
GeneralRe: Quantity, not quality Pin
CARPETBURNER28-May-09 22:24
CARPETBURNER28-May-09 22:24 
GeneralRe: Quantity, not quality Pin
Jeroen De Dauw28-May-09 22:39
Jeroen De Dauw28-May-09 22:39 
GeneralRe: Quantity, not quality Pin
Tristan Rhodes28-May-09 23:28
Tristan Rhodes28-May-09 23:28 
GeneralRe: Quantity, not quality Pin
PIEBALDconsult31-May-09 16:07
mvePIEBALDconsult31-May-09 16:07 
GeneralRe: Quantity, not quality Pin
Vasudevan Deepak Kumar1-Jun-09 0:34
Vasudevan Deepak Kumar1-Jun-09 0:34 
GeneralRe: Quantity, not quality Pin
PIEBALDconsult1-Jun-09 1:42
mvePIEBALDconsult1-Jun-09 1:42 
GeneralRe: Quantity, not quality Pin
Jörgen Sigvardsson12-Jun-09 6:53
Jörgen Sigvardsson12-Jun-09 6:53 
GeneralRe: Quantity, not quality Pin
ClementsDan13-Jun-09 0:44
ClementsDan13-Jun-09 0:44 
GeneralRe: Quantity, not quality Pin
Vasudevan Deepak Kumar1-Jun-09 0:31
Vasudevan Deepak Kumar1-Jun-09 0:31 
GeneralRe: Quantity, not quality Pin
J4amieC3-Jun-09 0:11
J4amieC3-Jun-09 0:11 
GeneralRe: Quantity, not quality Pin
CPallini4-Jun-09 1:38
mveCPallini4-Jun-09 1:38 
GeneralRe: Quantity, not quality Pin
John R. Shaw19-Jun-09 20:28
John R. Shaw19-Jun-09 20:28 
GeneralOne instance of an application [modified] PinPopular
akyriako7826-May-09 21:48
akyriako7826-May-09 21:48 
JokeRe: One instance of an application Pin
AWdrius26-May-09 22:33
AWdrius26-May-09 22:33 
GeneralRe: One instance of an application Pin
Rajesh R Subramanian26-May-09 23:26
professionalRajesh R Subramanian26-May-09 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.