Click here to Skip to main content
15,888,803 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: What should you do if assigning is going to crash your application? Pin
Vladimir Svyatski1-Dec-11 6:22
professionalVladimir Svyatski1-Dec-11 6:22 
GeneralRe: What should you do if assigning is going to crash your application? Pin
VallarasuS3-Dec-11 20:24
VallarasuS3-Dec-11 20:24 
GeneralRe: What should you do if assigning is going to crash your application? Pin
YvesDaoust1-Dec-11 2:41
YvesDaoust1-Dec-11 2:41 
GeneralRe: What should you do if assigning is going to crash your application? Pin
BobJanova1-Dec-11 5:25
BobJanova1-Dec-11 5:25 
GeneralRe: What should you do if assigning is going to crash your application? Pin
dawmail3331-Dec-11 14:53
dawmail3331-Dec-11 14:53 
GeneralRe: What should you do if assigning is going to crash your application? Pin
BobJanova2-Dec-11 0:11
BobJanova2-Dec-11 0:11 
GeneralRe: What should you do if assigning is going to crash your application? Pin
TorstenFrings2-Dec-11 0:21
TorstenFrings2-Dec-11 0:21 
GeneralRe: What should you do if assigning is going to crash your application? Pin
KP Lee2-Dec-11 21:44
KP Lee2-Dec-11 21:44 
I love the error message!

VUnreal wrote:
MessageBox.Show(ex.Message, "Serialization error has happened.",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

That's assuming an error is thrown. (I've seen the computer do impossible things several times, so I wouldn't put it past it.)
Serialization isn't happening here. No information about where it is happening. Oh shoot, it has ex.Message in it. at first I thought it wouldn't even tell you what was wrong.

Oh, lets throw in an icon to show this is an important error message.

The name of the routine is interesting. You're in a type safe environment that has an invalid type passed into the string and you are going to "fix" it by passing the invalid type back into the string. Really "advanced" thinking going on here.
Rant+1 -1 code patch.... or how to make my brain explode.... PinPopular
Alberto Bar-Noy28-Nov-11 1:12
Alberto Bar-Noy28-Nov-11 1:12 
GeneralRe: +1 -1 code patch.... or how to make my brain explode.... Pin
KP Lee2-Dec-11 23:35
KP Lee2-Dec-11 23:35 
GeneralRe: +1 -1 code patch.... or how to make my brain explode.... Pin
Alberto Bar-Noy3-Dec-11 0:57
Alberto Bar-Noy3-Dec-11 0:57 
GeneralRe: +1 -1 code patch.... or how to make my brain explode.... Pin
KP Lee3-Dec-11 2:16
KP Lee3-Dec-11 2:16 
GeneralRe: +1 -1 code patch.... or how to make my brain explode.... Pin
Alberto Bar-Noy3-Dec-11 4:27
Alberto Bar-Noy3-Dec-11 4:27 
GeneralRe: +1 -1 code patch.... or how to make my brain explode.... Pin
KP Lee3-Dec-11 2:32
KP Lee3-Dec-11 2:32 
Questionzero int? Pin
b1054374821-Nov-11 12:33
b1054374821-Nov-11 12:33 
AnswerRe: zero int? Pin
CDP180221-Nov-11 23:30
CDP180221-Nov-11 23:30 
GeneralRe: zero int? Pin
Nagy Vilmos21-Nov-11 23:50
professionalNagy Vilmos21-Nov-11 23:50 
GeneralRe: zero int? Pin
CDP180221-Nov-11 23:52
CDP180221-Nov-11 23:52 
GeneralRe: zero int? Pin
KP Lee2-Dec-11 23:51
KP Lee2-Dec-11 23:51 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 2:11
harold aptroot3-Dec-11 2:11 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 3:02
KP Lee3-Dec-11 3:02 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 3:27
harold aptroot3-Dec-11 3:27 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 10:21
KP Lee3-Dec-11 10:21 
GeneralRe: zero int? Pin
harold aptroot3-Dec-11 10:42
harold aptroot3-Dec-11 10:42 
GeneralRe: zero int? Pin
KP Lee3-Dec-11 11:06
KP Lee3-Dec-11 11:06 

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.