Click here to Skip to main content
15,912,329 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: Replace what? Pin
Brady Kelly29-Apr-08 5:23
Brady Kelly29-Apr-08 5:23 
JokeRe: Replace what? Pin
Spacix One2-May-08 5:28
Spacix One2-May-08 5:28 
GeneralUseless... Pin
Dave Sexton22-Apr-08 23:00
Dave Sexton22-Apr-08 23:00 
QuestionRe: Useless... Pin
CPallini22-Apr-08 23:22
mveCPallini22-Apr-08 23:22 
GeneralRe: Useless... Pin
Spunky Coder23-Apr-08 0:22
Spunky Coder23-Apr-08 0:22 
GeneralRearranging... Pin
CPallini23-Apr-08 2:08
mveCPallini23-Apr-08 2:08 
GeneralRe: Useless... Pin
Stephen Hewitt23-Apr-08 21:21
Stephen Hewitt23-Apr-08 21:21 
GeneralRe: Useless... Pin
BadKarma23-Apr-08 1:09
BadKarma23-Apr-08 1:09 
This is to catch the possibility of that the function failed to return.
The code in the catch should then be
protected void Foo()
{
  //...
  PreProcess(arg);
  //...
}


private void PreProcess(string arg)
{
  try
  {
    return;
  }
  catch(Exception ex)
  {
    // failed to return, run (fake restart) the program again
    main();
  }
}


codito ergo sum

JokeRe: Useless... Pin
elektrowolf23-Apr-08 3:39
elektrowolf23-Apr-08 3:39 
GeneralRe: Useless... Pin
Dave Sexton23-Apr-08 4:03
Dave Sexton23-Apr-08 4:03 
GeneralRe: Useless... Pin
StM0n23-Apr-08 20:15
StM0n23-Apr-08 20:15 
GeneralRe: Useless... Pin
MarkB77723-Apr-08 20:26
MarkB77723-Apr-08 20:26 
GeneralRe: Useless... Pin
Pete O'Hanlon23-Apr-08 22:25
mvePete O'Hanlon23-Apr-08 22:25 
GeneralRe: Useless... Pin
Saurabh.Garg27-Apr-08 4:06
Saurabh.Garg27-Apr-08 4:06 
GeneralRe: Useless... Pin
Dave Sexton27-Apr-08 22:20
Dave Sexton27-Apr-08 22:20 
GeneralRe: Useless... Pin
Saurabh.Garg27-Apr-08 22:29
Saurabh.Garg27-Apr-08 22:29 
GeneralRe: Useless... Pin
Dave Sexton27-Apr-08 22:45
Dave Sexton27-Apr-08 22:45 
GeneralRe: Useless... Pin
Spacix One28-Apr-08 7:22
Spacix One28-Apr-08 7:22 
GeneralRe: Useless... Pin
Yasser Azeem15-May-08 2:07
Yasser Azeem15-May-08 2:07 
GeneralOh man... Pin
MarkB77720-Apr-08 20:06
MarkB77720-Apr-08 20:06 
QuestionRe: Oh man... Pin
CPallini20-Apr-08 21:43
mveCPallini20-Apr-08 21:43 
GeneralRe: Oh man... Pin
MarkB77720-Apr-08 21:56
MarkB77720-Apr-08 21:56 
JokeRe: Oh man... Pin
Vasudevan Deepak Kumar21-Apr-08 5:51
Vasudevan Deepak Kumar21-Apr-08 5:51 
GeneralRe: Oh man... Pin
CPallini21-Apr-08 6:06
mveCPallini21-Apr-08 6:06 
GeneralRe: Oh man... Pin
rbuchana21-Apr-08 12:44
rbuchana21-Apr-08 12:44 

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.