Click here to Skip to main content
15,887,338 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: Access granted! Pin
GibbleCH9-Jun-11 3:55
GibbleCH9-Jun-11 3:55 
GeneralRe: Access granted! Pin
Lutosław9-Jun-11 4:56
Lutosław9-Jun-11 4:56 
GeneralRe: Access granted! Pin
Rob Grainger12-Jun-11 22:38
Rob Grainger12-Jun-11 22:38 
GeneralRe: Access granted! Pin
TorstenH.9-Jun-11 22:01
TorstenH.9-Jun-11 22:01 
GeneralRe: Access granted! Pin
Lutosław10-Jun-11 2:26
Lutosław10-Jun-11 2:26 
GeneralRe: Access granted! Pin
Br.Bill13-Jun-11 7:56
Br.Bill13-Jun-11 7:56 
GeneralRe: Access granted! Pin
Gary Huck13-Jun-11 8:47
Gary Huck13-Jun-11 8:47 
GeneralRe: Access granted! Pin
englebart13-Jun-11 9:20
professionalenglebart13-Jun-11 9:20 
As to the return thing...

Camp 1 says, when writing a method/function, you should have one entry point and one exit point. For languages that use return to exit the method, this implies a single return at the end of the method/function. Using this model sometimes involves multiple nested if statements.

Camp 2 might say I like to validate all preconditions and immediately return if something appears amiss, but then I have one return at the bottom for the real answer.

Camp 3 might say, I use assert() for things like Camp 2 does with returns, but I still have one return at the bottom.

Camp 4 might say, just throw a return in wherever it makes sense.

Camp X, might pick and choose what they want from other camps.
GeneralRe: Access granted! Pin
Br.Bill13-Jun-11 10:13
Br.Bill13-Jun-11 10:13 
GeneralRe: Access granted! Pin
TorstenH.13-Jun-11 11:53
TorstenH.13-Jun-11 11:53 
GeneralRe: Access granted! Pin
Br.Bill13-Jun-11 12:13
Br.Bill13-Jun-11 12:13 
GeneralRe: Access granted! Pin
patbob13-Jun-11 14:08
patbob13-Jun-11 14:08 
GeneralRe: Access granted! Pin
Michael D. O'Connor14-Jun-11 3:11
Michael D. O'Connor14-Jun-11 3:11 
GeneralAfter All My Years PinPopular
AspDotNetDev7-Jun-11 13:44
protectorAspDotNetDev7-Jun-11 13:44 
GeneralRe: After All My Years Pin
BobJanova8-Jun-11 0:34
BobJanova8-Jun-11 0:34 
GeneralRe: After All My Years Pin
walterhevedeich8-Jun-11 13:55
professionalwalterhevedeich8-Jun-11 13:55 
GeneralRe: After All My Years Pin
Philippe Mori13-Jun-11 13:29
Philippe Mori13-Jun-11 13:29 
GeneralIt came out... PinPopular
Lutosław7-Jun-11 11:49
Lutosław7-Jun-11 11:49 
GeneralRe: It came out... Pin
gavindon7-Jun-11 11:58
gavindon7-Jun-11 11:58 
GeneralRe: It came out... Pin
Lutosław7-Jun-11 12:04
Lutosław7-Jun-11 12:04 
GeneralRe: It came out... Pin
StM0n7-Jun-11 20:32
StM0n7-Jun-11 20:32 
GeneralRe: It came out... Pin
Lutosław7-Jun-11 22:59
Lutosław7-Jun-11 22:59 
GeneralRe: It came out... Pin
StM0n7-Jun-11 23:04
StM0n7-Jun-11 23:04 
GeneralRe: It came out... Pin
Lutosław9-Jun-11 23:47
Lutosław9-Jun-11 23:47 
GeneralRe: It came out... Pin
StM0n10-Jun-11 0:05
StM0n10-Jun-11 0:05 

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.