Click here to Skip to main content
15,913,722 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: How to increment a variable [modified] Pin
CurtD24-Mar-09 8:34
CurtD24-Mar-09 8:34 
GeneralIt's the thought that counts PinPopular
CurtD18-Mar-09 15:07
CurtD18-Mar-09 15:07 
GeneralRe: It's the thought that counts Pin
Michael Bookatz19-Mar-09 7:24
Michael Bookatz19-Mar-09 7:24 
GeneralRe: It's the thought that counts Pin
CurtD19-Mar-09 12:34
CurtD19-Mar-09 12:34 
GeneralRe: It's the thought that counts Pin
Tony Pottier19-Mar-09 23:29
Tony Pottier19-Mar-09 23:29 
GeneralRe: It's the thought that counts Pin
Luc Pattyn19-Mar-09 7:28
sitebuilderLuc Pattyn19-Mar-09 7:28 
GeneralRe: It's the thought that counts Pin
Mycroft Holmes20-Mar-09 0:18
professionalMycroft Holmes20-Mar-09 0:18 
GeneralRe: It's the thought that counts Pin
supercat920-Mar-09 6:30
supercat920-Mar-09 6:30 
Reminds me of Resume Next from a particularly dark past!

Somewhat, but it's easier to limit the effect of catch-and-ignore to a single statement. Realistically, there are quite a few circumstances in which if an error happens very often the developer should be made aware of it, but beyond that there's no particularly useful action the code can take in response to an error.

For example, if a field that affects the display of a control is changed outside the UI thread, it's necessary to use BeginInvoke to let the control update itself. If the BeginInvoke works, great. If it fails because someone closed a window at just the "right" time, so what? It's important to ensure that the code doesn't waste time repeatedly trying to BeginInvoke a control after it's disposed, but otherwise occasional invocation failures should be expected and I really don't see anything useful to be done with them other than ignore them.
GeneralRe: It's the thought that counts Pin
CurtD20-Mar-09 12:03
CurtD20-Mar-09 12:03 
GeneralRe: It's the thought that counts Pin
Thomas Weller23-Mar-09 8:58
Thomas Weller23-Mar-09 8:58 
GeneralRe: It's the thought that counts Pin
CurtD24-Mar-09 8:12
CurtD24-Mar-09 8:12 
GeneralRe: It's the thought that counts Pin
Vikram A Punathambekar6-Apr-09 19:55
Vikram A Punathambekar6-Apr-09 19:55 
GeneralRe: It's the thought that counts Pin
BillW3323-Apr-09 6:47
professionalBillW3323-Apr-09 6:47 
GeneralRe: It's the thought that counts Pin
Megidolaon24-Mar-09 2:11
Megidolaon24-Mar-09 2:11 
GeneralVB Select Case statement incarnation of C# if (true = [condition]) Pin
David St. Hilaire14-Mar-09 6:36
David St. Hilaire14-Mar-09 6:36 
GeneralRe: VB Select Case statement incarnation of C# if (true = [condition]) Pin
Lutosław14-Mar-09 7:42
Lutosław14-Mar-09 7:42 
GeneralRe: VB Select Case statement incarnation of C# if (true = [condition]) Pin
David St. Hilaire14-Mar-09 10:34
David St. Hilaire14-Mar-09 10:34 
GeneralRe: VB Select Case statement incarnation of C# if (true = [condition]) Pin
Lutosław14-Mar-09 15:08
Lutosław14-Mar-09 15:08 
GeneralRe: VB Select Case statement incarnation of C# if (true = [condition]) Pin
supercat916-Mar-09 7:20
supercat916-Mar-09 7:20 
GeneralRe: VB Select Case statement incarnation of C# if (true = [condition]) Pin
Mark Hurd16-Mar-09 15:14
Mark Hurd16-Mar-09 15:14 
RantThe Horror... [modified] Pin
Megidolaon13-Mar-09 1:42
Megidolaon13-Mar-09 1:42 
GeneralRe: The Horror... Pin
PIEBALDconsult13-Mar-09 6:29
mvePIEBALDconsult13-Mar-09 6:29 
GeneralRe: The Horror... Pin
Lutosław13-Mar-09 11:04
Lutosław13-Mar-09 11:04 
GeneralRe: The Horror... Pin
Megidolaon16-Mar-09 0:52
Megidolaon16-Mar-09 0:52 
GeneralRe: The Horror... Pin
Lutosław13-Mar-09 11:23
Lutosław13-Mar-09 11:23 

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.