Click here to Skip to main content
15,881,898 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: The return a detailed error string but ignore its contents and assume it's only ever the failure case you expected to occur but couldn't be bothered to handle properly pattern Pin
Dan Neely2-Aug-13 7:07
Dan Neely2-Aug-13 7:07 
GeneralRe: The return a detailed error string but ignore its contents and assume it's only ever the failure case you expected to occur but couldn't be bothered to handle properly pattern Pin
Lutosław6-Aug-13 23:18
Lutosław6-Aug-13 23:18 
GeneralRe: The return a detailed error string but ignore its contents and assume it's only ever the failure case you expected to occur but couldn't be bothered to handle properly pattern Pin
BillW3330-Aug-13 5:40
professionalBillW3330-Aug-13 5:40 
GeneralRe: The return a detailed error string but ignore its contents and assume it's only ever the failure case you expected to occur but couldn't be bothered to handle properly pattern Pin
Dan Neely30-Aug-13 5:53
Dan Neely30-Aug-13 5:53 
GeneralMost Unhelpful Message Ever PinPopular
NickPace29-Jul-13 9:26
NickPace29-Jul-13 9:26 
GeneralRe: Most Unhelpful Message Ever Pin
ZurdoDev29-Jul-13 9:49
professionalZurdoDev29-Jul-13 9:49 
GeneralRe: Most Unhelpful Message Ever Pin
Member 460889830-Jul-13 7:24
Member 460889830-Jul-13 7:24 
GeneralRe: Most Unhelpful Message Ever Pin
Richard Deeming29-Jul-13 10:05
mveRichard Deeming29-Jul-13 10:05 
I can beat that - some code I was asked to help with had hundreds of methods where a database query was wrapped with:
C#
try
{
   // Some code here...
}
catch (Exception exception) // Gotta catch 'em all!
{
   // Take a string property, convert it to a string, and then throw it away:
   exception.Message.ToString(); 
   
   // Throw away any meaningful information from the exception,
   // and replace it with a mis-spelled pile of elephant dung:
   throw new Exception("Exception occured");
}

Needless to say, every call to one of these methods was wrapped with:
C#
try
{
   // Do a whole bunch of stuff...
   CallTheQueryMethod();
   // Do a load more crap...
}
catch (Exception exception)
{
   // Tell the user something bad happened:
   MessageBox.Show(this, exception.Message);
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Most Unhelpful Message Ever Pin
NickPace29-Jul-13 11:48
NickPace29-Jul-13 11:48 
GeneralRe: Most Unhelpful Message Ever Pin
James Lonero3-Aug-13 5:32
James Lonero3-Aug-13 5:32 
GeneralRe: Most Unhelpful Message Ever Pin
Lutosław6-Aug-13 23:29
Lutosław6-Aug-13 23:29 
GeneralRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 1:27
pasztorpisti7-Sep-13 1:27 
GeneralRe: Most Unhelpful Message Ever Pin
Lutosław6-Aug-13 23:25
Lutosław6-Aug-13 23:25 
GeneralRe: Most Unhelpful Message Ever Pin
NickPace7-Aug-13 4:53
NickPace7-Aug-13 4:53 
JokeRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 1:27
pasztorpisti7-Sep-13 1:27 
GeneralRe: Most Unhelpful Message Ever Pin
ExcellentOrg21-Aug-13 0:40
ExcellentOrg21-Aug-13 0:40 
GeneralRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 1:24
pasztorpisti7-Sep-13 1:24 
GeneralRe: Most Unhelpful Message Ever Pin
pasztorpisti7-Sep-13 1:16
pasztorpisti7-Sep-13 1:16 
GeneralRe: Most Unhelpful Message Ever Pin
Dennis E White29-Jul-13 11:18
professionalDennis E White29-Jul-13 11:18 
GeneralRe: Most Unhelpful Message Ever PinPopular
NickPace29-Jul-13 11:46
NickPace29-Jul-13 11:46 
GeneralRe: Most Unhelpful Message Ever Pin
Stefan_Lang30-Jul-13 0:27
Stefan_Lang30-Jul-13 0:27 
GeneralRe: Most Unhelpful Message Ever Pin
vonb29-Jul-13 19:59
vonb29-Jul-13 19:59 
GeneralRe: Most Unhelpful Message Ever Pin
Gary Wheeler30-Jul-13 1:51
Gary Wheeler30-Jul-13 1:51 
GeneralRe: Most Unhelpful Message Ever Pin
vonb30-Jul-13 2:37
vonb30-Jul-13 2:37 
GeneralRe: Most Unhelpful Message Ever Pin
Bernhard Hiller29-Jul-13 22:25
Bernhard Hiller29-Jul-13 22:25 

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.