Click here to Skip to main content
15,887,175 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: Best use of exception handling Pin
Sauro Viti13-Oct-10 6:17
professionalSauro Viti13-Oct-10 6:17 
JokeRe: Best use of exception handling Pin
Adriaan Davel14-Oct-10 19:24
Adriaan Davel14-Oct-10 19:24 
GeneralRe: Best use of exception handling Pin
richard_k26-Oct-10 22:34
richard_k26-Oct-10 22:34 
GeneralRe: Best use of exception handling Pin
Vimalsoft(Pty) Ltd14-Oct-10 20:26
professionalVimalsoft(Pty) Ltd14-Oct-10 20:26 
JokeRe: Best use of exception handling Pin
Jonas Hammarberg14-Oct-10 22:22
professionalJonas Hammarberg14-Oct-10 22:22 
GeneralRe: Best use of exception handling Pin
Mel Padden15-Oct-10 1:58
Mel Padden15-Oct-10 1:58 
GeneralRe: Best use of exception handling Pin
Vercas15-Oct-10 22:17
Vercas15-Oct-10 22:17 
GeneralRe: Best use of exception handling Pin
T Jenniges15-Oct-10 12:39
T Jenniges15-Oct-10 12:39 
I once fixed something similar that was coded by a newbie, it went
something like this:


private void HandleException(Exception ex)
{
try
{
... Code to handle exception that would always throw an exception
... Can't recall exactly what it was since it was 3 years ago
}
catch (Exception ex)
{
HandleException(ex);
}
}

The function would recursively call itself and cause a stack overflow exception.
GeneralRe: Best use of exception handling Pin
kxal17-Oct-10 0:38
kxal17-Oct-10 0:38 
GeneralFalse selection... Pin
lordofawesome11-Oct-10 1:20
lordofawesome11-Oct-10 1:20 
GeneralRe: False selection... Pin
CDP180211-Oct-10 1:48
CDP180211-Oct-10 1:48 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 2:11
lordofawesome11-Oct-10 2:11 
GeneralRe: False selection... PinPopular
CDP180211-Oct-10 2:18
CDP180211-Oct-10 2:18 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 2:22
lordofawesome11-Oct-10 2:22 
GeneralRe: False selection... Pin
CDP180211-Oct-10 2:32
CDP180211-Oct-10 2:32 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 2:41
lordofawesome11-Oct-10 2:41 
GeneralRe: False selection... Pin
CDP180211-Oct-10 2:46
CDP180211-Oct-10 2:46 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 3:02
lordofawesome11-Oct-10 3:02 
GeneralRe: False selection... Pin
CDP180211-Oct-10 3:10
CDP180211-Oct-10 3:10 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 3:37
lordofawesome11-Oct-10 3:37 
GeneralRe: False selection... Pin
CDP180211-Oct-10 4:01
CDP180211-Oct-10 4:01 
GeneralRe: False selection... Pin
josda100011-Oct-10 4:05
josda100011-Oct-10 4:05 
GeneralRe: False selection... PinPopular
Stryder_111-Oct-10 3:35
Stryder_111-Oct-10 3:35 
GeneralRe: False selection... Pin
CDP180211-Oct-10 3:46
CDP180211-Oct-10 3:46 
GeneralRe: False selection... Pin
lordofawesome11-Oct-10 3:46
lordofawesome11-Oct-10 3:46 

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.