Click here to Skip to main content
15,887,214 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: Error Messages 101 PinPopular
Sentenryu22-Dec-13 22:17
Sentenryu22-Dec-13 22:17 
GeneralRe: Error Messages 101 Pin
Brisingr Aerowing23-Dec-13 3:08
professionalBrisingr Aerowing23-Dec-13 3:08 
GeneralRe: Error Messages 101 Pin
Albert Holguin28-Dec-13 12:06
professionalAlbert Holguin28-Dec-13 12:06 
GeneralRe: Error Messages 101 Pin
Albert Holguin28-Dec-13 12:07
professionalAlbert Holguin28-Dec-13 12:07 
GeneralRe: Error Messages 101 Pin
Brisingr Aerowing29-Dec-13 9:44
professionalBrisingr Aerowing29-Dec-13 9:44 
GeneralRe: Error Messages 101 Pin
Rob Grainger31-Dec-13 0:38
Rob Grainger31-Dec-13 0:38 
GeneralRe: Error Messages 101 Pin
Brisingr Aerowing3-Jan-14 6:20
professionalBrisingr Aerowing3-Jan-14 6:20 
GeneralSo, a colleague inherited a project to restructure a product.. PinPopular
Sentenryu17-Dec-13 2:46
Sentenryu17-Dec-13 2:46 
He called for my help when he couldn't understand a piece of code.

After 2 hours digging, we finally understood what the code does. A convoluted piece of junk that just shows a string on a field on the page.

But the most facepalming thing we found was this piece of "code":

C#
public string GetLimitMessage(int total, int limit){
    if(total > limit)
       try
       {
           return "The Limit has been reached!"
       } 
       catch(Exception)
       {
           return "";
       }
    else
       return string.Empty;
}


Aside from translation (the original is on Portuguese), that's the exactly code we found. We are still facepalming.
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Kornfeld Eliyahu Peter17-Dec-13 3:06
professionalKornfeld Eliyahu Peter17-Dec-13 3:06 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Sentenryu17-Dec-13 4:21
Sentenryu17-Dec-13 4:21 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
BillW3317-Dec-13 4:26
professionalBillW3317-Dec-13 4:26 
JokeRe: So, a colleague inherited a project to restructure a product.. Pin
Freak3017-Dec-13 22:51
Freak3017-Dec-13 22:51 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Nagy Vilmos18-Dec-13 0:03
professionalNagy Vilmos18-Dec-13 0:03 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Sentenryu18-Dec-13 0:05
Sentenryu18-Dec-13 0:05 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
OriginalGriff18-Dec-13 0:51
mveOriginalGriff18-Dec-13 0:51 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Rob Grainger18-Dec-13 2:47
Rob Grainger18-Dec-13 2:47 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Sentenryu18-Dec-13 0:04
Sentenryu18-Dec-13 0:04 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
BobJanova18-Dec-13 2:17
BobJanova18-Dec-13 2:17 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
0bx18-Dec-13 10:55
0bx18-Dec-13 10:55 
GeneralRe: So, a colleague inherited a project to restructure a product.. Pin
Brisingr Aerowing20-Dec-13 5:29
professionalBrisingr Aerowing20-Dec-13 5:29 
GeneralYes - It was me Pin
Marco Bertschi16-Dec-13 0:53
protectorMarco Bertschi16-Dec-13 0:53 
GeneralRe: Yes - It was me Pin
Manfred Rudolf Bihy16-Dec-13 1:23
professionalManfred Rudolf Bihy16-Dec-13 1:23 
GeneralRe: Yes - It was me Pin
Marco Bertschi16-Dec-13 3:18
protectorMarco Bertschi16-Dec-13 3:18 
GeneralRe: Yes - It was me Pin
Manfred Rudolf Bihy16-Dec-13 3:22
professionalManfred Rudolf Bihy16-Dec-13 3:22 
GeneralRe: Yes - It was me Pin
Marco Bertschi16-Dec-13 4:31
protectorMarco Bertschi16-Dec-13 4:31 

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.