Click here to Skip to main content
15,892,809 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: Why not: // just shoot me! Pin
Oshtri Deka20-May-13 22:15
professionalOshtri Deka20-May-13 22:15 
GeneralRe: Why not: // just shoot me! Pin
Gary Wheeler21-May-13 1:17
Gary Wheeler21-May-13 1:17 
GeneralRe: Why not: // just shoot me! Pin
englebart21-May-13 2:39
professionalenglebart21-May-13 2:39 
GeneralRe: Why not: // just shoot me! Pin
Gary Wheeler21-May-13 2:48
Gary Wheeler21-May-13 2:48 
GeneralRe: Why not: // just shoot me! Pin
esaulsberry21-May-13 2:59
esaulsberry21-May-13 2:59 
GeneralRe: Why not: // just shoot me! Pin
agolddog21-May-13 3:35
agolddog21-May-13 3:35 
GeneralRe: Why not: // just shoot me! Pin
esaulsberry21-May-13 3:40
esaulsberry21-May-13 3:40 
GeneralRe: Why not: // just shoot me! Pin
StatementTerminator21-May-13 3:51
StatementTerminator21-May-13 3:51 
I can think of situations where it might be appropriate to do something like that.

For instance, suppose you are implementing a "like" button or something similar. It's not critical that it works and let's assume that it's unreliable for reasons beyond the programmer's control, like maybe it depends on an external service which is not always available.

So in that case maybe it's OK to swallow the exception since it's not unusual and nothing will really break if it fails, so you just silently fail and the user can try again if they want. There aren't many situations like this in programming though, and you still should probably log the exceptions.

I'm pretty sure that something like account.Save() is a bit too important to treat this way, though.
GeneralRe: Why not: // just shoot me! Pin
Lutosław24-May-13 0:02
Lutosław24-May-13 0:02 
GeneralRe: Why not: // just shoot me! Pin
StatementTerminator24-May-13 3:49
StatementTerminator24-May-13 3:49 
GeneralRe: Why not: // just shoot me! Pin
Lutosław24-May-13 11:36
Lutosław24-May-13 11:36 
GeneralRe: Why not: // just shoot me! Pin
Luiz Monad27-May-13 7:15
professionalLuiz Monad27-May-13 7:15 
GeneralRe: Why not: // just shoot me! Pin
Lutosław27-May-13 10:34
Lutosław27-May-13 10:34 
GeneralRe: Why not: // just shoot me! Pin
StatementTerminator21-May-13 3:43
StatementTerminator21-May-13 3:43 
JokeRe: Why not: // just shoot me! Pin
RafagaX21-May-13 5:02
professionalRafagaX21-May-13 5:02 
GeneralRe: Why not: // just shoot me! Pin
KP Lee21-May-13 13:06
KP Lee21-May-13 13:06 
GeneralRe: Why not: // just shoot me! Pin
sparkytheone21-May-13 9:59
sparkytheone21-May-13 9:59 
GeneralRe: Why not: // just shoot me! Pin
Pablo Aliskevicius22-May-13 3:19
Pablo Aliskevicius22-May-13 3:19 
GeneralRe: Why not: // just shoot me! Pin
esaulsberry22-May-13 3:21
esaulsberry22-May-13 3:21 
GeneralRe: Why not: // just shoot me! Pin
Konstardiy from Tbilisi26-May-13 23:07
Konstardiy from Tbilisi26-May-13 23:07 
GeneralCan't people read the form description anymore? Pin
Rob Grainger16-May-13 3:20
Rob Grainger16-May-13 3:20 
GeneralRe: Can't people read the form description anymore? Pin
PIEBALDconsult16-May-13 4:21
mvePIEBALDconsult16-May-13 4:21 
JokeRe: Can't people read the form description anymore? Pin
Carlos Fonseca16-May-13 4:31
Carlos Fonseca16-May-13 4:31 
GeneralRe: Can't people read the form description anymore? Pin
PIEBALDconsult16-May-13 4:37
mvePIEBALDconsult16-May-13 4:37 
GeneralRe: Can't people read the form description anymore? Pin
BrainiacV21-May-13 3:32
BrainiacV21-May-13 3:32 

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.